Create text node with custom render function in Vue.js

后端 未结 5 1504
栀梦
栀梦 2021-02-13 02:26

I\'m using a my-link component to wrap an anchor tag on demand around various items. For that purpose a custom render method is used - however the

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-13 03:01

    In Vue 2.5.x, you can use this to render text nodes:

    render(createElement) {
        return createElement(() => {
            return document.createTextNode('Text');
        });
    }
    

提交回复
热议问题