Vue.js customizes a keyup instruction to input. What if you get the new value you just entered?

    Vue.directive("keyup", {
        //  DOM 
        bind: function() {
            console.log("keyup bind")
        },
        inserted: function(el, binding, vnode) {
            console.log("keyup inserted")
            if (that.mubiao.toString() == el.id) {
                //console.log("keyup inserted binding.value:" + binding.value)
            }
        },
        update: function(el, binding, vnode, oldVnode) {
            //console.log("keyup update binding.value:" + binding.value)
            let s = JSON.stringify
            console.log("keyup update binding.value:", s(binding.value))
        },
        componentUpdated: function(el, binding, vnode) {
            console.log(
                "keyup componentUpdated binding.value:" + binding.value
            )
            let s = JSON.stringify
            let str =
                "name: " +
                s(binding.name) +
                "<br>" +
                "value: " +
                s(binding.value) +
                "<br>" +
                "expression: " +
                s(binding.expression) +
                "<br>" +
                "argument: " +
                s(binding.arg) +
                "<br>" +
                "modifiers: " +
                s(binding.modifiers) +
                "<br>" +
                "vnode keys: " +
                Object.keys(vnode).join(", ")
            console.log("str:", str)
        },
        unbind: function(el, binding, vnode) {
            console.log("unbind")
        }
    })
Nov.30,2021

Can't you get it in the

update function?

write a demo to show you (you can copy and paste it all directly):

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js"></script>
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <input type="text" v-model="value" />
      <div v-view="value"></div>
    </div>
    <script>
      new Vue({
        el: "-sharpapp",
        data() {
          return {
            value: ""
          };
        },
        methods: {},
        directives: {
          view: {
            bind: function(el) {
              el.style.visibility = "hidden";
            },
            update: function(el, binding) {
              if (binding.value) {
                el.style.visibility = "visible";
                el.style.cssText = "width:50px;height:50px;background:-sharpf00;";
              } else {
                el.style.visibility = "hidden";
                el.style.cssText = "";
              }
            },
            unbind: function() {}
          }
        }
      });
    </script>
  </body>
</html>
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-1b3dc51-2c3d8.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-1b3dc51-2c3d8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?