hug-sun / element3

A Vue.js 3.0 UI Toolkit for IT Education. Build with JS&TS
https://e3.shengxinjing.cn/
MIT License
3.28k stars 1.01k forks source link

loading指令 #541

Closed a949066041 closed 3 years ago

a949066041 commented 3 years ago

使用指令时 打包后的v-show不是一个响应的visible,在指令内部调用el.instance.show()时,数据不会更新。 打包后的值应该是一个_ctx.visible

function render$V(_ctx, _cache, $props, $setup, $data, $options) {
  return openBlock(), createBlock(Transition, {
    name: "el-loading-fade",
    onAfterLeave: $setup.handleAfterLeave
  }, {
    default: withCtx(() => [withDirectives(createVNode("div", {
      class: ["el-loading-mask", [$props.customClass, {
        'is-fullscreen': $props.fullscreen
      }]],
      style: {
        backgroundColor: $props.background || ''
      }
    }, [createVNode("div", _hoisted_1$y, [!$props.spinner ? (openBlock(), createBlock("svg", _hoisted_2$m, [_hoisted_3$g])) : (openBlock(), createBlock("i", {
      key: 1,
      class: $props.spinner
    }, null, 2
    /* CLASS */
    )), $props.text ? (openBlock(), createBlock("p", _hoisted_4$8, toDisplayString($props.text), 1
    /* TEXT */
    )) : createCommentVNode("v-if", true)])], 6
    /* CLASS, STYLE */
    /* 
      loading打包后$props.visible 使用指令时不是一个响应式的 
      el.instance.show();指令调用时不生效
    */
    ), [[vShow, $props.visible]])]),
    _: 1
    /* STABLE */

  }, 8
  /* PROPS */
  , ["onAfterLeave"]);
}
cuixiaorui commented 3 years ago

感谢您的反馈

ElLoading 组件的问题会在 v0.0.39 修复

并且对应的 api 会有变化

请看文档:传送门