代码
<template> <div> <button @click="enableButtons">按钮1</button> <button :disabled="!isButton2Enabled" @click="ann">按钮2</button> <button :disabled="!isButton3Enabled" @click="ann">按钮3</button> </div>
</template> <script>
export default { data() { return { isButton2Enabled: false, isButton3Enabled: false, }; }, methods: { enableButtons() { this.isButton2Enabled = true; this.isButton3Enabled = true; }, ann(){console.log('shuchua')}},
};
</script>