How to receive directives instruction parameters in vue encapsulated components?

write an input box to build base-input , which focuses on managing styles and some ui logic. As the business expands, I need to customize the types that can be entered in the input box. Now I have written an instruction "only-num", how to pass this instruction from the outside when the caller calls base-input ?

Mar.05,2021

Custom hook-- ide/custom-directive.html" rel=" nofollow noreferrer "> https://cn.vuejs.org/v2/guide.
arg: the parameter passed to the instruction, optional. For example, in v-my-directive:foo, the parameter is "foo".
Vue.directive ('demo', {
bind: function (el, binding, vnode) {

)
var s = JSON.stringify
el.innerHTML =
  '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(', ')

}
})


I think it is possible to send props directly without instructions, and then write the corresponding logic in the component


does not need instructions, but props

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-1e55ee0-45386.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-1e55ee0-45386.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?