1 2 3 |
<audio src="/i/horse.ogg" controls="controls" controlsList="nodownload" oncontextmenu="return false"> Your browser does not support the audio element. </audio> |
1 2 3 |
<audio src="/i/horse.ogg" controls="controls" controlsList="nodownload" oncontextmenu="return false"> Your browser does not support the audio element. </audio> |
1 |
<audio ref="audio" autoplay controls src=""> </audio> |
播放当前时间:
1 |
let currentaduioduration = this.$refs.audio.duration //获取视频的总时长 |
道理其实很简单:思路就是使用vue的data数据给:src动态给值,自动播放就是audio的一个属性而已
1 2 3 4 5 6 7 8 |
<audio ref="audio" autoplay controls controlsList="nodownload" :src="currentRow.file_path" @ended="handleplaynext" ></audio> |
只要currentRow.file_path给值后,不为空就会自动播放,换新的值,重新播放新的语音,全自动
1 |
<el-button type="primary" :disabled="btnBoolean== 1 ? true : false">提交</el-button> |
按钮绑定disabled并判断
1 2 3 4 5 6 7 8 9 10 11 |
<el-table :data="tableData" :row-class-name="rouClassNameFn" @row-click = "onRowClick" style="width: 100%"> <el-table-column prop="date" label="日期" width="180"> </el-table-column> </el-table> |
首先把index通过row-class-name灌注到数据数组中,rouClassNameFn({row,rowIndex}) 然后再获取就可以了
1 2 3 4 5 6 7 |
rouClassNameFn({row, rowIndex}) { //把每一行的索引放进row row.index = rowIndex; }, onRowClick (row, event, column) { console.log(row) } |
1 2 |
:header-row-style="headerclass" :header-cell-style="headerclass" |
方法:
1 2 3 4 |
methods: { headerclass() { return 'background-color: rgba(242, 242, 242, 1)' }, |
1 2 3 4 5 6 |
<el-menu default-active="1" router=true > ... </el-menu> |
改为
1 2 3 4 5 6 |
<el-menu default-active="1" router > ... </el-menu> |
将true去掉就行了,解决!
我正在开发Vue.js应用程序,但无法将锚链接到组件中的某个div。 read more
1 2 3 4 |
{ "singleQuote":true, "semi":false } |
Unnecessary escape character: \. no-useless-escape
原因:
1 |
let reg = /^([a-zA-Z]|[0-9])(\w\\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/ |
改为
1 |
let reg = /^([a-zA-Z]|[0-9])(\w)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/ |
sass-loader版本过高运行错误TypeError: this.getOptions is not a function
1 2 3 4 |
// 卸载 npm uninstall --save less-loader // 安装 npm install -D sass-loader@10.x |
Failed to resolve Loader: sass-loader
安装 sass-loader组件到开发依赖
Cannot find module ‘sass’
npm install -D sass
npm install -D node-sass
error ‘XXXX’ is defined but never used no-unused-vars
1 |
"no-unused-vars": 'off' //.eslintrc.js文件 |
意思就是不让eslint校验,我的定义有没有用了。虽然不报错了,但未必是最好解决办法。