From f385e21a1be4ea7565617951a96fb826237a4443 Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Sun, 5 Jul 2020 03:15:20 -0500 Subject: [PATCH] Fix Vue compatibility (fix #790) - Fix inability to instantiate reactive Vue components by 1) handling each child of #main instead of #main itself and 2) skipping elements that are already Vue instances - Retain previous behavior of processing basic Vue rendering without the need for a markdown + + - + + - - - + + ``` -Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main' })` script is executed by default to create instance. +## Basic rendering -*README.md* - -````markdown -# Vue guide - -`v-for` usage. - -```html - -``` - - -```` - -You can manually initialize a Vue instance. - -*README.md* +Docsify will automatically render basic Vue content that does not require `data`, `methods`, or other instance features. ```markdown -# Vue demo + -
hello {{ msg }}
+ +``` +The HTML above will render the following: + + + + + +## Advanced usage + +Vue components and templates that require `data`, `methods`, computed properties, lifecycle hooks, etc. require manually creating a new `Vue()` instance within a ` ``` -!> In a Markdown file, only the script within the first script tag is executed. +The HTML & JavaScript above will render the following: -## Combine Vuep to write playground +
+

{{ message }}

-[Vuep](https://github.com/QingWei-Li/vuep) is a component for rendering Vue components with live editor and preview. Supports Vue component spec and JSX. + -*index.html* + + {{ counter }} + +
+ +!> Only the first ` - - - - - + - ``` -*README.md* +Add vuep markup to a markdown file (e.g. `README.md`): + ```markdown -# Vuep + - - - ``` -?> Example Refer to the [Vuep documentation](https://qingwei-li.github.io/vuep/). + + + + + + diff --git a/index.html b/index.html index 0443d1ca..579aff26 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,7 @@ +