Category · 43 articles

Template

Articles in the category Template.

2022

19 entries

Vue Tip: Change the Interpolation Delimiter

It is possible to adjust the delimiters used for text interpolation within the template to avoid conflicting with server-side frameworks that also use mustache syntax.

Vue tip1 minTemplate

Vue Tip: Use Vue Without Build Step

When using Vue from a CDN, no "build step" is involved. This makes the setup much more straightforward and is suitable for enhancing static HTML or integrating with a backend framework.

Vue tip1 minTemplateScript

Vue Tip: Defining and Registering Vue Web Components

Web Components is an umbrella term for a set of web native APIs that allows developers to create reusable custom elements. Vue has excellent support for both consuming and creating custom elements.

Vue tip1 minTemplateScript

Vue Tip: Typing Template Refs With TypeScript

Template refs only exist after the component is mounted. Thus, it’s necessary to type template refs with a union type that includes the DOM element type as well as null.

Vue tip1 minTemplateScript

Vue Tip: Creating a Custom Directive

In addition to the default set of directives like v-model or v-show, you can also register your own custom directives.

Vue tip2 minTemplate

Vue Tip: When to Use v-if

v-if has higher toggle costs while v-show has higher initial render costs.

Vue tip1 minTemplate

Vue Tip: Avoid Empty Wrapper for Conditions

There are many situations when you need to conditionally display multiple Vue components. To avoid "empty" wrappers you should use not use HTML tags.

Vue tip1 minTemplate

Vue Tip: Delay Loading Appearance of Spinner

Eager delay spinners are not a good user experience. They can make a snappy user interface feel slower. We want delay spinners to appear only after a perceivable delay.

Vue tip1 minTemplateScript

Vue Tip: Use Fallthrough Attributes

A 'fallthrough attribute' is an attribute or v-on event listener that is passed to a component, but is not explicitly declared in the receiving component's props or emits. Common examples of this include class, style, and id attributes.

Vue tip2 minTemplate

Vue Tip: Display Raw HTML

The double mustaches interpret the data as plain text, not HTML. To output real HTML, you will need to use the v-html directive.

Vue tip1 minTemplate

2021

1 entry

Vue Tip: Simple Expressions in Templates

Vue component templates should only include simple expressions, with more complex expressions refactored into computed properties or methods.

Vue tip1 minTemplate
Page 2 of 3