Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue3版本开启virtualHost编译到抖音小程序watch监听不生效 #5007

Open
YaWeiBoy opened this issue Jun 27, 2024 · 0 comments
Open

Comments

@YaWeiBoy
Copy link

<template>  
    <view>  
        <button @click="test">  
            test  
        </button>  
        <button @click="test1">test1</button>  
    </view>  
</template>  
<script setup>  
import { watch } from 'vue';  
const emits = defineEmits(['click', 'upload']);  
const props = defineProps({  
    name: {  
        type: String,  
        default: 'hello'  
    }  
})  
function test() {  
    emits('click');  
}  
function test1() {  
    emits('upload');  
}  
watch(() => props.name,  
    (val) => {  
        console.log(val)  
    }, {  
    immediate: true  
})  
</script>
<template>  
  <view class="content">  
    <button1 :name="name" @click="test" @upload="upload"></button1>  

    <button @click="name = 'aaaaaaaaaa'">点击修改name</button>  
  </view>  
</template>  

<script setup>  
import { ref } from 'vue';  

const name = ref('test')  
function test() {  
  console.log("click")  
}  
function upload() {  
  console.log('upload')  
}  
</script>  

预期结果:打印aaaaaaaaaa
实际结果:无

@YaWeiBoy YaWeiBoy changed the title vue3版本编译到抖音小程序watch监听不生效 vue3版本开启virtualHost编译到抖音小程序watch监听不生效 Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant