腾讯云优惠券
呆错后台管理框架基础组件介绍之(AJAX组件)
人气:322 更新:2022-08-11

手动加载JS

<script>
$(document).ready(function () {
    window.daicuo.ajax.script(daicuo.config.root+'apps/markdown/static/editor.js');
});
</script>

监听加载JS

<div class="{$form.class_right|default='col-md-6'}" data-toggle="script" data-js='{:json_encode([$path_root."apps/markdown/static/editor.js"])}'>
    <textarea {if $form['readonly']}readonly{/if} {if $form['disabled']}disabled{/if} {if $form['required']}required{/if} {if $form['autofocus']}autofocus{/if} class="dc-editor {$form.class_right_control|default='form-control form-control-sm'}" id="{:DcEmpty($form['id'],$form['name'])}" name="{$form.name}" rows="{$form.rows|default='12'}" placeholder="{$form.placeholder}" data-upload-url="{$path_upload}">{$form.value|DcHtml}</textarea>
    {if $form['tips']}
    <small class="{$form.class_tips|default='form-text text-muted'}">{$form.tips}</small>
    {/if}
    <div id="dc-editor-upload"></div>
</div>