We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
<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 实际结果:无
The text was updated successfully, but these errors were encountered:
No branches or pull requests
预期结果:打印aaaaaaaaaa
实际结果:无
The text was updated successfully, but these errors were encountered: