You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
616 B
35 lines
616 B
<template> |
|
<div class="app"> |
|
<h3>我是app组件(祖)</h3> |
|
</div> |
|
</template> |
|
|
|
<script> |
|
import {reactive, ref, toRefs, provide, readonly, isReactive, isRef, isReadonly, isProxy} from "vue"; |
|
|
|
export default { |
|
name: 'App', |
|
setup() { |
|
let car = reactive({ |
|
name:'奔驰', |
|
price: '40W' |
|
}) |
|
let car2 = readonly(car) |
|
let sum = ref(0) |
|
|
|
console.log(isRef(sum)) |
|
console.log(isReactive(car)) |
|
console.log(isReadonly(car2)) |
|
console.log(isProxy(car)) |
|
|
|
return {...toRefs(car)} |
|
} |
|
} |
|
</script> |
|
|
|
<style> |
|
.app{ |
|
background-color: gray; |
|
padding: 10px; |
|
} |
|
</style> |