HTML
<span :style="{ display : displayTitle }" @dblclick="showInput()">
{{ node.title }}
</span>
<input :style="{ display : displayTitleInput }" type="text"
@blur="hideInput1" @keydown="hideInput2"
@input="changeTitle(node.id , $event.target.value)"
:value="node.title">
Run Code Online (Sandbox Code Playgroud)
JS
data() {
return {
displayTitle: "inline-block",
displayTitleInput: "none"
};
},
showInput() {
this.displayTitle = "none"
this.displayTitleInput = "inline-block"
},
hideInput1() {
this.displayTitle = "inline-block"
this.displayTitleInput = "none"
},
hideInput2(event) {
if (event.keyCode === 13) {
this.hideInput1()
}
},
Run Code Online (Sandbox Code Playgroud)
我是初学日语网站开发人员.抱歉,我不擅长英语.
HTML在"v-for"(v-for="node in list")中.
双击文本时,它会变为<input>.
我希望能够在出现时关注输入.
我尝试了这个,但它没有用.
HTML
<span :style="{ display : …Run Code Online (Sandbox Code Playgroud) export default {
props: {
goToSomePage: {
type: Function,
default: () => { this.$router.push({ name: 'some-page' }) }
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想做这样的事情,但“这个”未定义。
有什么办法可以解决这个问题吗?
我想给出一个默认操作并在回调函数中使用“this”。
我是日本 Web 开发人员。
我想在英语方面做得更好。
表示“单击按钮时”的函数的正确名称是什么?
“点击按钮”?
“点击按钮”?
“点击按钮”?
“点击按钮”?
我喜欢“onButtonClick”然后“onClickButton”,“onButtonClicked”然后“onClickedButton”。
我正在使用Vue-Cli3.0.我把这个模块用于Vue.js. https://github.com/holiber/sl-vue-tree
这是Vue.js的可自定义可拖动树组件,但我发现它无法复制对象的功能.
https://github.com/holiber/sl-vue-tree/blob/master/src/sl-vue-tree.js#L715
因为这里.
JSON.parse(JSON.stringify(entity))
Run Code Online (Sandbox Code Playgroud)
所以我使用了这个模块并编辑了复制功能.
https://www.npmjs.com/package/clone
var clone = require('clone');
copy(entity) {
return clone(entity)
},
Run Code Online (Sandbox Code Playgroud)
通过这种方式,可以正确复制对象的功能.
我已经测试过了,它运行正常.性能没有问题但是我遇到了控制台错误.
[Vue warn]: Invalid default value for prop "multiselectKey": Props with type Object/Array must use a factory function to return the default value.
found in
---> <SlVueTree>
Run Code Online (Sandbox Code Playgroud)
我想知道擦除此错误的方法.感谢您阅读我的问题.