提交 07ac4c78 编写于 作者: DCloud_JSON's avatar DCloud_JSON

删除测试文件

上级 b226c303
<template>
<view>
<view v-if="inputIsShow">
<template v-for="i in 2" :key="i">
<input type="number" ref="input" class="input" placeholder="input" />
</template>
<button type="primary" @click="doFocus">doFocus</button>
</view>
<button @click="inputIsShow = !inputIsShow">{{inputIsShow?'隐藏':'显示'}}</button>
</view>
</template>
<script>
export default {
data() {
return {
inputIsShow: true
}
},
methods: {
doFocus() {
console.log('doFocus');
(this.$refs["input"] as Element[])[0].focus();
}
}
}
</script>
<style>
.input {
border: 1px solid #aaa;
margin: 15px;
padding: 5;
}
</style>
\ No newline at end of file
<template>
<view>
<input class="input" placeholder="请输入" v-model="text" @input="onInput" />
</view>
</template>
<script>
export default {
data() {
return {
text: ""
}
},
methods: {
onInput(e : InputEvent) {
e.stopPropagation()
e.preventDefault()
}
}
}
</script>
<style>
.input {
border: 1px solid #aaa;
margin: 15px;
padding: 5;
}
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册