Skip to content

Commit 7655c2e

Browse files
author
jack
committed
判断变量是否存在
1 parent 4dad841 commit 7655c2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/MyRating.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Description :
33
* @Date : 2022-01-16 22:01:25 +0800
44
* @Author : JackChou
5-
* @LastEditTime: 2022-01-16 23:59:10 +0800
5+
* @LastEditTime: 2022-01-20 00:09:36 +0800
66
* @LastEditors : JackChou
77
-->
88
<template>
@@ -63,7 +63,7 @@ export default {
6363
// myRatingComponent.value = 4;
6464
myRatingComponent.setAttribute('value', 4)
6565
console.log('set value')
66-
myRatingComponent.getValue({ maxValue: 10, value: 5 }).then(value => {
66+
myRatingComponent && myRatingComponent.getValue({ maxValue: 10, value: 5 }).then(value => {
6767
console.log('get value', value)
6868
})
6969
console.log(this.$refs.myRating)

0 commit comments

Comments
 (0)