后台快捷操作

查看源码

属性参考

注册名 data-controller="admin-actions"
Targets
Values
Outlets

读取 data-value 里的 id → 快捷方式 id 映射,用 template 克隆出表单,替换页面上对应的占位元素

挂载后会把下面这个占位元素替换成表单(action 指向 /org/admin/shortcuts/42):

占位元素
<template id="template_admin_actions">
  <form class="button_to" method="post">
    <button class="button">操作</button>
  </form>
</template>

<div id="shortcut_1">占位</div>
<div data-controller="admin-actions" data-admin-actions-data-value='{"shortcut_1":"42"}'></div>

依赖宿主应用提供 id 为 template_admin_actions 的