current location:Home > Technical Articles > Web Front-end > Vue.js

  • The principle of scoped in vue
    The principle of scoped in vue
    The scoped property in Vue limits CSS styles to components by appending unique class names to avoid accidental interference. It uses a Sass/Less preprocessor to convert scoped styles into CSS with unique class names, enabling CSS style isolation, reusability, and clarity. But it may slightly reduce performance, and the style can only be applied to elements within the component. It is recommended to use scoped when a component has a unique visual style, needs to prevent style conflicts, or creates reusable components.
    Vue.js 487 2024-05-02 21:09:19
  • The role of scope in vue
    The role of scope in vue
    The scope attribute in Vue is used to limit the visible range of data and methods in child components to prevent naming conflicts with parent components, thereby improving the readability, maintainability and performance of the code, but it also limits the availability of data and methods, increasing It reduces the communication difficulty between parent and child components.
    Vue.js 479 2024-05-02 21:06:50
  • The difference between hash and history in vue
    The difference between hash and history in vue
    The difference between hash and history modes in Vue routing is: URL format: hash uses the # prefix, and history uses the regular path. Browser processing: hash is only processed by the browser and will not be sent to the server; history uses the history API and will send a request to cause the page to be reloaded. Advantages and Disadvantages: Hash has good browser compatibility and does not require server-side configuration, but the URL is not beautiful; history URL is beautiful and can use back-end routing and server-side rendering, but requires server-side configuration.
    Vue.js 964 2024-05-02 21:06:33
  • What does the custom directive in vue start with?
    What does the custom directive in vue start with?
    In Vue, custom directives start with the v- prefix to distinguish them from native Vue directives. They allow developers to extend Vue's functionality and create reusable directives to handle specific tasks.
    Vue.js 857 2024-05-02 21:06:16
  • How to use v-for in vue
    How to use v-for in vue
    The v-for directive is used to iterate over an array or object and render child components or templates for each element. Its syntax is <div v-for="item in items">, where item is the alias for each element and items is the array or object to be iterated over. v-for can render lists, tables and other structures. In order to track child components when elements are updated or rearranged, each child component needs to be assigned a unique key. Range variables such as index, $index, first, last, even and odd can be accessed in the v-for loop, but range variables can only be used in templates, not in JavaScript
    Vue.js 770 2024-05-02 21:03:52
  • How to write a normal loop in vue
    How to write a normal loop in vue
    Ordinary loops in Vue.js use the v-for instruction to traverse arrays or objects and create elements: Syntax: v-for="item in items", where items is the object to be traversed and item is the loop item. Example: Traverse the ['apple', 'banana', 'cherry'] array and generate a <li> list. In addition, you can also traverse { apple: 'red', banana: 'yellow', cherry: 'black' } objects. Special attributes: :key is used to specify a unique key, :index contains the index of the loop item. Loops can be nested to
    Vue.js 471 2024-05-02 21:03:33
  • The difference between created and mounted in vue
    The difference between created and mounted in vue
    The difference between created and mounted in Vue lies in execution time and data access capabilities: created: called when the component is initialized. It can only access Vue instance data and cannot interact with the DOM. mounted: Called after DOM is mounted. It can access Vue instance data and DOM elements and interact with DOM.
    Vue.js 730 2024-05-02 21:03:15
  • How to use slot in vue
    How to use slot in vue
    Slots in Vue.js simplify application development by rendering specific content at different locations in a component. There are three types of slots: named slots, default slots, and scoped slots. The benefits of slots include code reuse, flexibility, and scalability. In the example, the parent component defines Slot, and the child component uses Slot to present different content.
    Vue.js 572 2024-05-02 21:01:06
  • The role of created in vue
    The role of created in vue
    The created hook in Vue is called after the Vue instance is created and before the DOM is mounted. It is mainly used to perform tasks related to data processing, state initialization and dependency retrieval, avoiding heavy operations after DOM mounting.
    Vue.js 595 2024-05-02 21:00:48
  • How to use filters in vue
    How to use filters in vue
    Vue.js filters can be used to transform or format data for custom display in templates. Global filters are available throughout the application, while local filters are available only within components or templates. Filters can be applied using the pipe symbol (|) followed by the filter name and arguments, which are passed in colons (:), and multiple filters can be chained to apply multiple transformations.
    Vue.js 506 2024-05-02 21:00:33
  • How to loop through an object in vue
    How to loop through an object in vue
    To loop through an object in Vue, you can use the v-for directive, whose syntax is: v-for="item in object". Each property value can be rendered by accessing the object's properties (dot notation or square bracket notation) and bound to the object properties using the v-bind directive.
    Vue.js 813 2024-05-02 20:57:27
  • Can variables be added within require brackets in Vue?
    Can variables be added within require brackets in Vue?
    Variables can be added within require brackets in Vue. This allows components to be loaded dynamically based on variable values, increasing code flexibility and promoting code reuse. Make sure the variable points to the correct module path.
    Vue.js 994 2024-05-02 20:57:13
  • What does disabled mean in vue
    What does disabled mean in vue
    In Vue.js, the disabled attribute determines whether a form element is disabled, causing the element to be grayed out, uneditable, unable to interact or submit data. It can be applied to input boxes, text areas, select boxes, radio/check buttons, and buttons to prevent users from editing or submitting specific fields, limit interaction, or create dynamic forms.
    Vue.js 961 2024-05-02 20:54:56
  • The role of ref in vue
    The role of ref in vue
    ref is used in Vue.js to get a reference to a component or DOM element, establishing a connection from the Vue instance to the component or DOM element, allowing direct access and manipulation. Usage of ref includes: Directly accessing components or DOM elements Communicating with subcomponents Manipulating the DOM outside the template
    Vue.js 1104 2024-05-02 20:54:40
  • The role of refs in vue
    The role of refs in vue
    Refs in Vue are used to access DOM elements or component instances through JavaScript, providing direct DOM access, intra-component interaction and form validation capabilities. When using it, be careful to avoid usage within templates, performance impact, and avoid frozen objects. Other scenarios include event handling, component communication, and asynchronous requests.
    Vue.js 833 2024-05-02 20:54:19

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28