项目作者: berhalak

项目描述 :
vue vue-cli-plugin portal
高级语言: TypeScript
项目地址: git://github.com/berhalak/vue-cli-plugin-portal.git
创建时间: 2020-01-24T00:17:15Z
项目社区:https://github.com/berhalak/vue-cli-plugin-portal

开源协议:GNU General Public License v3.0

下载


vue-cli-plugin-portal

Simple portal vue cli plugin, done by rewriting vue files

Installation:
vue add vue-cli-plugin-portal

Or through vue ui, search for vue-cli-plugin-portal

Sample (also see test.ts)

Transforms vue template from alias form (you can use interpolation of args and content)

  1. <template>
  2. <div>
  3. <div>
  4. <portal name="a">
  5. <content ></content>
  6. </portal>
  7. <portal name="b" title="B title" ></portal>
  8. <portal name="c" ></portal>
  9. </div>
  10. <card portal="b">
  11. <h1>${title}</h1>
  12. </card>
  13. <card portal="a">
  14. <h1>${content}</h1>
  15. </card>
  16. <card portal="c">
  17. <h1>C title</h1>
  18. </card>
  19. </div>
  20. </template>
  21. <script>
  22. </script>

To:

  1. <template>
  2. <div>
  3. <div>
  4. <card portal="a">
  5. <h1>
  6. <content ></content>
  7. </h1>
  8. </card>
  9. <card portal="b">
  10. <h1>B title</h1>
  11. </card>
  12. <card portal="c">
  13. <h1>C title</h1>
  14. </card>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. </script>