amis调用vue函数测试
This commit is contained in:
@@ -2,13 +2,35 @@
|
|||||||
import {onMounted} from 'vue'
|
import {onMounted} from 'vue'
|
||||||
import {amisRender} from '../utils.js'
|
import {amisRender} from '../utils.js'
|
||||||
|
|
||||||
|
const toastMessage = () => {
|
||||||
|
alert('click in vue')
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
amisRender(
|
amisRender(
|
||||||
'#amis-home',
|
'#amis-home',
|
||||||
information => {
|
information => {
|
||||||
return {
|
return {
|
||||||
type: 'page',
|
type: 'page',
|
||||||
body: 'Home'
|
body: [
|
||||||
|
"Home",
|
||||||
|
{
|
||||||
|
type: 'action',
|
||||||
|
label: '点击',
|
||||||
|
onEvent: {
|
||||||
|
click: {
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
actionType: 'custom',
|
||||||
|
script: (context, doAction, event) => {
|
||||||
|
toastMessage()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user