The Beauty of TypeScript,这个主题由微软中国的工程师韩骏分享的,介绍了TS的优点,主要是解决JS开发时的痛点,引入类型,支持编译并兼容JS,适用于多人大型的项目开发。介绍了@ts-check、@ts-uncheck、@ts-ignore和any作为从JS迁移TS的一些辅助手段。
mouseenter: 鼠标进入目标区域,不会冒泡并且,在后代元素上移动到当前元素不会触发(MDN参考:Similar to mouseover, it differs in that it doesn’t bubble and that it isn’t sent when the pointer is moved from one of its descendants’ physical space to its own physical space.)
mouseleave: 鼠标离开目标区域并包括所有子元素,不会冒泡(MDN参考: Similar to mouseout, it differs in that it doesn’t bubble and that it isn’t sent until the pointer has moved from its physical space and the one of all its descendants.)
EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.
/** * Represents a book. * @constructor * @param {string} title - The title of the book. * @param {string} author - The author of the book. */ functionBook(title, author) {
}
/** Class representing a point. */ classPoint { /** * Create a point. * @param {number} x - The x value. * @param {number} y - The y value. */ constructor(x, y) { // ... }
/** * Get the x value. * @return {number} The x value. */ getX() { // ... }
/** * Get the y value. * @return {number} The y value. */ getY() { // ... }
/** * Convert a string containing two comma-separated numbers into a point. * @param {string} str - The string containing two comma-separated numbers. * @return {Point} A Point object. */ staticfromString(str) { // ... } }
classCardComponentextendsHTMLElement { constructor (){ super(); const shadow = this.attachShadow({mode: 'open'}); // Clone the template so that it can be attched to the shadowroot const template = document.getElementById('card-view'); const templateInstance = template.content.cloneNode(true); shadow.appendChild(templateInstance); } }
constAPI_KEY = '*YOUR_API_KEY*'; const url = `http://api.giphy.com/v1/gifs/trending?api_key=` + API_KEY + `&limit=1`; export {API_KEY, url}; // export the url so that i can be used extrnally.