问题标签 [html5-template]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - Polymer 1.0 数组拼接正在删除数组中的错误项目
我正在尝试在 Polymer 中创建一个简单的待办事项列表,并且添加部分正在工作。当我单击项目旁边的“删除”图标时,它会删除最近添加的项目,而不是应该删除的项目。看起来它得到了错误的数组索引,我不知道如何修复它?谢谢!
javascript - 嵌套元素(Web 组件)无法获取其模板
我使用具有两个自定义元素 (v1) 的 Web 组件制作了一个简单的示例,其中一个嵌套在另一个元素中。索引.html:
应用容器.html:
工具栏.html:
但是在 toolbar.htmldocument.currentScript
中与在 app-container.html 中相同,因此querySelector('#app-toolbar')
无法找到带有 id 的模板app-toolbar
。如何解决这个问题呢?
在 Chrome 55 上测试的示例(没有 polyfill)。
web-component - Web 组件中的模板 html 和模板字符串
使用 html 模板(然后是 html 导入)创建 Web 组件还是使用模板字符串更好?这些方法的优缺点是什么?
node.js - Jade / Pug 版本的 标签
我今天和一个朋友一起工作,他使用 EJS 作为模板,我正在使用 Jade / Pug,我在他的代码中看到了一些东西,这部分对我很有用,但我们找不到与这个标签相关的任何东西,有什么想法吗?
感谢您的帮助。
html - 如何检测是否不支持 webcomponentsjs polyfill?
有没有一种简单的方法来检测用户的浏览器是否既不支持Web Components也不支持webcomponentsjs polyfill?
谢谢!
javascript - 避免克隆 HTMLTemplate 来检索 innerHTML?
我在<template>
标签中有所有模板以提高运行时性能(避免渲染),但我想知道当我需要它们的内容来编译我的 Underscore 模板时是否正确使用它们。我想要的是 DOM 元素的字符串内容,但如果不从影子 DOM 中克隆它,我似乎无法访问它。我正在这样做:
这行得通,但是有没有更有效的方法可以避免克隆?
javascript - Web 组件(香草,无聚合物):如何加载 content?
i'm new on web component. I checked some example, but i really can't figure out how to load (insert in the DOM) the content of a of a separate web component. Starting from
i'm new on web component. I checked some example, but i really can't figure out how to load (insert in the DOM) the content of a of a separate web component. Starting from this example , I put this code in a file named my-element.html:
This is my index.html:
I'm on latest Chrome 56, so i don't need polyfill. I run polyserve, and only "Does it works?" appears. I tried (like the original example) the "customElements.define" syntax instead of "document.registerElement", but won't work. Have you some ideas? And what have I to change if i don't want to use shadow dom?
thanks
How to get the voip call log information in application - Call Kit
I have implemented call kit in my voip app in which i generate the call logs for incoming or outgoing calls (visible on phone recent tab).
When i click on call logs it will open my app. I've overridden the UIApplication
delegate method to get the handler.
But i unable to get call log related information in NSUserActivity
.
How i can get the call log information in my app?
Any help much appreciate. Thanks!
i'm new on web component. I checked some example, but i really can't figure out how to load (insert in the DOM) the content of a of a separate web component. Starting from
i'm new on web component. I checked some example, but i really can't figure out how to load (insert in the DOM) the content of a of a separate web component. Starting from this example , I put this code in a file named my-element.html: This is my index.html: I'm on latest Chrome 56, so i don't need polyfill. I run polyserve, and only "Does it works?" appears. I tried (like the original example) the "customElements.define" syntax instead of "document.registerElement", but won't work. Have you some ideas? And what have I to change if i don't want to use shadow dom? thanks
I have implemented call kit in my voip app in which i generate the call logs for incoming or outgoing calls (visible on phone recent tab).
When i click on call logs it will open my app. I've overridden the UIApplication
delegate method to get the handler.
But i unable to get call log related information in NSUserActivity
.
How i can get the call log information in my app?
Any help much appreciate. Thanks!
javascript - 获取错误link.import在Firefox中为空
javascript - 引用 web 组件中的模板标签
这是我的 index.html:
这是我的 component.html
我试图不使用 ' ...querySelector('link[href$="component.html"]').import ..' 我已在评论中插入它。我想在不插入“component.html”的情况下引用模板标签。它不起作用,但我不明白为什么。