3
我正在創建一個元素,它需要一個參數:userid。 在組件的模板中,我有一個core-ajax標記,它需要將該屬性作爲參數傳遞。如何在元素定義中將屬性傳遞給core-ajax?
我這樣做是這樣的:
<template attributes="userid">
<core-ajax
auto
url="../../ajax/gettoday.php"
handleAs="json"
method="post"
params='{"userid": "{{userid}}"}'
response="{{today}}"></core-ajax>
...
</template>
難道這就是接受PARAMS字符串中的屬性?