We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
示例:
<template> <div @click="{{console.log('123');count = count + 1;}}"></div> </template>
${}
<template> <div @click="{{() => { console.log('123');count = count + 1; }}}"></div> </template>
或者绑定方法,将逻辑写在方法内:
<template> <div @click="{{ handleClick }}"></div> </template>
function handleClick() { console.log('123'); count = count + 1; }
The text was updated successfully, but these errors were encountered:
方案一,SFC 不支持这种语法,需要用户自行包裹箭头函数
Sorry, something went wrong.
支持方案一,做好报错提示就好 =。=
Done
No branches or pull requests
示例:
方案一:SFC 模板中禁止该语法
${}
占位符中仅允许书写 JavaScript 表达式而非语句。为保证运行时模板和 SFC 模板尽量一致,建议 SFC 模板中也不支持该种写法;或者绑定方法,将逻辑写在方法内:
方案二:仅 SFC 模板支持,文档中强调此为语法糖
The text was updated successfully, but these errors were encountered: