1.cs.vue
<template> <view class="demo"> <!-- text是renderjsmodule名称 --> <view> {{data}}</view> <button @click="text.onClick2"> 按钮2 </button> <button @click="text.onClick1"> 按钮1 </button> </view> </template> <!-- 普通的script标签 --> <script> export default { data(){ return { data: "hello", } }, methods:{ } } </script> <!-- renderjs的script标签 --> <script module="text" lang="renderjs"> export default { methods:{ onClick1(event, ownerInstance) { console.log('点击了按钮1'); console.log(event); console.log(ownerInstance); }, onClick2(event,ownerInstance) { console.log('点击了按钮2'); console.log(event); console.log(ownerInstance); }, } } </script>
标签:uniapp,console,log,按钮,ownerInstance,使用,data,event,renderjs From: https://www.cnblogs.com/zhangyouwu/p/18238856