e 3 months ago
parent
commit
1f7c7a6da9
1 changed files with 6 additions and 6 deletions
  1. 6 6
      13.Vue3/project2/src/components/Demo7.vue

+ 6 - 6
13.Vue3/project2/src/components/Demo7.vue

@@ -25,16 +25,16 @@ let fullName = computed({
     },
     set(val) {
         console.log(val,'val')
-
+        let [a1,a2] = val.split('-');
+        firstName.value = a1;
+        lastName.value = a2;
     }
 })
 function changeName() {
     console.log("点击了")
-    fullName.set('胡-图图')
-}
-function getName() {
-    console.log("哈哈哈")
-    return firstName.value + lastName.value; 
+    console.log("哈哈哈",fullName.value)
+    // return firstName.value + lastName.value; 
+     fullName.value = '糖-果'
 }
 </script>
 <style lang='scss' scoped>