提交 534539fb 编写于 作者: 杜庆泉's avatar 杜庆泉

hello uts 兼容 vue2语法

上级 eac9f9c4
import App from './App' import App from './App'
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue'
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
return { return {
app app
} }
} }
// #endif
<template> <template>
<div>
<button @click="logStr">打印字符串</button> <button @click="logStr">打印字符串</button>
<button @click="logFloat">打印浮点数</button> <button @click="logFloat">打印浮点数</button>
<button @click="logInt">打印整数</button> <button @click="logInt">打印整数</button>
...@@ -7,6 +8,7 @@ ...@@ -7,6 +8,7 @@
<button @click="logFile">打印文件</button> <button @click="logFile">打印文件</button>
<button @click="logDate">打印日期</button> <button @click="logDate">打印日期</button>
<button @click="logDateCombine">组合打印日期</button> <button @click="logDateCombine">组合打印日期</button>
</div>
</template> </template>
<script> <script>
......
<template> <template>
<div>
{{ret}} {{ret}}
<button @click="instanceCreate">多实例创建测试</button> <button @click="instanceCreate">多实例创建测试</button>
</div>
</template> </template>
......
<template> <template>
<div>
<button @click="inputArrayTest">传入数组参数</button> <button @click="inputArrayTest">传入数组参数</button>
<button @click="inputParamTest">传入复杂对象参数</button> <button @click="inputParamTest">传入复杂对象参数</button>
<button @click="returnArrayTest">返回数组参数</button> <button @click="returnArrayTest">返回数组参数</button>
<button @click="returnParamTest">返回复杂对象参数</button> <button @click="returnParamTest">返回复杂对象参数</button>
<button @click="callbackArrayTest">异步返回数组</button> <button @click="callbackArrayTest">异步返回数组</button>
<button @click="callbackParamTest">异步返回复杂对象</button> <button @click="callbackParamTest">异步返回复杂对象</button>
</div>
</template> </template>
<script> <script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册