Cách định nghĩa component và sử dụng các directive phổ biến trong Vue 3
Trong Vue 3, bạn có thể khai báo component thông qua hàm defineComponent để tận dụng hỗ trợ kiểu và IntelliSense tốt hơn.
import { defineComponent } from 'vue';
export default defineComponent({
name: 'AlertBox',
props: {
content: {
type: String,
required: true
}
},
setup(props) {
const triggerAlert = () => {
...
Đăng vào ngày 22 tháng 6 lúc 21:07