Vue updated dynamically, but dom did not render successfully

data: {
    percentge: ""
},
watch:{
        percentage: function (curVal, oldVal) {
            this.changePercent(curVal)
        }
    },
methods: {
        changePercent: function (curVal) {
            this.$nextTick(() => {
                this.percentage = curVal
            }
        },

clipboard.png

as shown in the figure, I am listening for a percentage, and then I have such a button in dom. If the percentage is 10, the button will be displayed, but although the percentage is 10, the properties of the button still do not take effect. I feel that the percentage of dom has not been updated

.

disabled is a Boolean value. You write the strings "true" and "false"


disabled: this.percentge === '10' ? true : false

.

look at the current code guess, there are several possible problems:

  • Misspelling of percentge attribute in data
  • look at i-button is written in iview. The diabled attribute should be passed in as the props of the component to control the button to enable or disable
  • .
  • disabled to set a Boolean value, use disabled: this.percentge = '10' directly

disabled is a Boolean value

disabled: this.percentge === '10'
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b372ac-405fc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b372ac-405fc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?