UNPKG

minix-template

Version:

minix template

82 lines (80 loc) 1.53 kB
/* * @Description: * @Autor: tangsj * @Date: 2022-05-12 11:12:38 * @LastEditTime: 2022-05-23 15:49:09 */ import router from '@system.router' import prompt from '@system.prompt' export default { data: { clipBoardList:[ { name:'setString', // url:'pages/base/canlUse/index', describe:'设置剪切板内容' }, { name:'getString', // url:'pages/base/log/index', describe:'获取剪切板内容' } ] }, goRouter(url){ router.push({ uri: url, }) }, /** * @description: 设置剪切板内容 * @param {*} * @return {*} */ setString(){ const params='ceshi2222' this.$app.$def.bridge.setString(params) .then((res)=>{ prompt.showToast({ message: res, duration: 200, }) }).catch((err)=>{ prompt.showToast({ message: '接口调用失败', duration: 200, }) }) }, /** * @description: 获取剪切板内容 * @param {*} * @return {*} */ getString(){ this.$app.$def.bridge.getString() .then((res)=>{ prompt.showToast({ message: res, duration: 200, }) }).catch((err)=>{ prompt.showToast({ message: '接口调用失败', duration: 200, }) }) }, testBridge(name){ switch(name){ case 'setString': this.setString() break; case 'getString': this.getString() break; default: break; } } }