angular 自定义web组件: 首先创建一个名为myCustom的组件. 引入app.module: ... import {customComponent} from ' ./myCustom.component'; @NgModule({ declarations:[AppComponent,customComponent], entryComponents:[customComponent] .... }) export class AppModule{} 全局注册: app.comp…
在online web应用中,经常有这样的需求,能够让用户通过浏览器来输入代码,同时能够根据不同的代码来做语法高亮.大家已知有很多相应的javascript库来实现语法高亮的功能,比如codemirror就是一个不错的选择.而我们使用angular开发web应用,那么就希望能够使用directive来实现这个功能,以便能够很好的重用.https://www.polymer-project.org/ 可以得到更多可重用web组件的信息 下面是如何使用我们的  <code-editor>  的:…
一.报错截图 [Vue warn]: Unknown custom element: <wzwzihello> - did you register the component correctly? For recursive components, make sure to provide the "name" option. 错误代码 <!DOCTYPE html> <html lang="en"> <head>…
vue浏览器报错,如下 vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: <router-Link> - did you register the component correctly? For recursive components, make sure to provide the "name" option. found in ---> <App> at src/App…
web components & publish custom element & npm https://www.webcomponents.org/publish Polymer 1.12.0 https://www.polymer-project.org/ https://github.com/polymer https://lit-html.polymer-project.org/ https://lit-element.polymer-project.org/ xgqfrms 2…
关于vue报错: [Vue warn]: Unknown custom element: <sapn> - did you register the component correctly? For recursive components, make sure to provide the "name" option. found in ---> <Evaluate> at src/views/index/Evaluate.vue<Index>…
前言  说起Custom Element那必然会想起那个相似而又以失败告终的HTML Component.HTML Component是在IE5开始引入的新技术,用于对原生元素作功能"增强",虽然仅仅被IE所支持,虽然IE10也开始放弃它了,虽然掌握了也用不上,但还是不影响我们以研究的心态去了解它的:) 把玩HTML Component  HTML Component简称HTC,它由定义和应用两部分组成.定义部分写在.htc文件中(MIME为text/x-component),由HTC…
概述 各种网站往往需要一些相同的模块,比如日历.调色板等等,这种模块就被称为“组件”(component).Web Component就是网页组件式开发的技术规范. 采用组件进行网站开发,有很多优点. (1)管理和使用非常容易.加载或卸载组件,只要添加或删除一行代码就可以了. <link rel="import" href="my-dialog.htm"> <my-dialog heading="A Dialog">Lor…
前言  通过<WebComponent魔法堂:深究Custom Element 之 面向痛点编程>,我们明白到其实Custom Element并不是什么新东西,我们甚至可以在IE5.5上定义自己的alert元素.但这种简单粗暴的自定义元素并不是我们需要的,我们需要的是具有以下特点的自定义元素: 自定义元素可通过原有的方式实例化(<custom-element></custom-element>,new CustomElement()和document.createEle…
前言 Web Component不是新东西,几年前的技术,但是受限于浏览器兼容性,一直没有大规模应用在项目里,直到现在(2018年年末),除IE仍不支持之外,其它主流浏览器都支持Web Component. Web Component不是一个东西,它分为四部分,分别是 template--模板 HTML import--HTML导入 Shadow DOM--影子DOM Custom Elements--自定义元素 template 前端模板也不是个新概念,templatejs.ejs等模板引擎早…