vue中自定义指令directive,提交防抖案例debounce
关键API介绍Vue.directive( id, [definition])
参数:
{string} id
{Function | Object} [definition]
12345678910111213141516// 注册Vue.directive('myDirective', { bind: function () {}, inserted: function () {}, update: function () {}, componentUpdated: function () {}, unbind: function () {}})// 注册 (指令函数)Vue.directive('myDirective', function () { // 这里将会被 `bind` 和 `update` 调用})// getter,返回已注册的指 ...
echarts 设置初始点在原点
问题描述在使用echarts折线图中渲染出来的图表数据不是从原点坐标开始,而是在两点的中间显示。
解决方法在xAxis字段中添加一个boundaryGap属性;
123456xAxis: { data: ['0时', '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时', '22时', '23时& ...
Hbuilder 打开终端无法输入指令
问题描述在使用HbuliderX打开终端时,出现如下情况。无法输入。
解决问题原因是:配置启动终端的路径存在问题。
1.进入Hbuilder安装位置
2.打开HBuilderX\plugins\builtincef3terminal\script 下 main.js;
3.将shell的值写成绝对路径,如将shell=”powershell.exe”改为shell=’C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe’;
4.重启HbuliderX,再打开终端
如果重启后依旧没有效果,可以如下尝试:将shell的值替换成cmd.exe 保存后再重启。
css 字体渐变色
问题描述给Icon字体,添加一个渐变色。
解决问题12345678910111213141516171819202122232425<template> <view> <view> <text class="icon-guzhangliebiao cu-text-orange" style="font-size: 80rpx;"/> <view>故障列表</view> </view> <view> <text class="icon-repair cu-text-red" style="font-size: 80rpx;"/> <view>故障处理</view> </view> </view></template><style scoped> .cu-text-orange { backgr ...
uniapp 小程序支付功能
项目需求项目生成订单,需要用户通过小程序进行支付。
解决方案使用uni.requestPayment(),调用小程序中的付款功能。
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253<script> export default { data() { return { request:{ id:xxxxx, info:'xxxx' } } }, onLoad() { }, methods: { // 提交订单 subOrder() { this.post("api/order/createOrder", this.request).then(res => { if ( ...