Date: 2021/4/13Category: Tag: JavaScript, Vue, demo
VUE 深度监听
<view class="submit" style="bottom:{{bottom}}px">
<view class="serch-view">
<input bindconfirm="toSubmit"
value="{{code}}"
bindfocus="inputFocus"
bindblur="inputBlur"
adjust-position="{{false}}"
class="block-main"
type="text"
confirm-type="go"
cursor-spacing="100" class="course-search"></input>
<view bindtap="search" class="search-button">发 送</view>
</view>
vue 参数为html
<div v-html="someData"></div>
在Vue中绑定键盘按键,并触发事件
问题描述: 在做项目的时候遇到 使用键盘的左右键来翻页的功能,一开始想当然的使用JS的绑定键盘事件发现并不好用 在Vue中要借用$nextTick来处理一下
created() {
//监听左右箭头按键的键盘按下事件
this.$nextTick(() => {
document.onkeydown = (e) => {
if (e.keyCode == 39 && this.currentPage < this.pageCount) {
//这是右箭头,
this.currentPage++;
} else if (e.keyCode == 37 && this.currentPage > 1) {
//这是左箭头,
this.currentPage--;
}
};
});
}
安装Koa插件时遇到的问题
问题描述:
电脑中缺少python环境和桌面应用程序
解决方法: 用Powershell或者cmd 用管理员身份打开
npm install --global --production windows-build-tools