Skip to content

Commit 9bb758d

Browse files
committed
Merge branch 'master' into dev
2 parents ec78291 + c3fe2b6 commit 9bb758d

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ and finally:
102102
| Vue Event | Description |
103103
|---|---|
104104
| data | If the `toc` proerty is set to `true`, this event will occur containing any TOC data, if there is any. This is an array of flat data |
105-
| tree | If the `toc` proerty is set to `true`, this event will occur containing any TOC data, if there is any. This is an array of hierarchial data |
106105

107106
Given markdown that looks like this:
108107
```
@@ -114,13 +113,28 @@ Given markdown that looks like this:
114113
The TOC data looks like this:
115114
```
116115
[
117-
{id: 'h2-Heading', title: 'h2 Heading', level: 2},
118-
{id: 'h3-Heading', title: 'h3 Heading', level: 3}
116+
{id: 'h2-Heading', title: 'h2 Heading', level: 2, children: []},
117+
{id: 'h3-Heading', title: 'h3 Heading', level: 3, children: []}
119118
]
120119
```
121120

121+
# QMarkdown Vue Methods
122+
| Vue Method | Description |
123+
|---|---|
124+
| makeTree | Pass into this function the results from the @data to have the data array transformed into a hieracrhial tree. |
125+
126+
The TOC data will be transformed to the following:
127+
```
128+
[
129+
{id: 'h2-Heading', title: 'h2 Heading', level: 2, children: [
130+
{id: 'h3-Heading', title: 'h3 Heading', level: 3, children: []}
131+
]}
132+
133+
]
134+
```
122135

123136
# QMarkdown Vue Slots
124-
| Vue Property | Description |
137+
| Vue Slot | Description |
125138
|---|---|
126139
| default | The default slot - this slot overrides anything that may be passed in via the `src` property. |
140+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@quasar/quasar-app-extension-qmarkdown",
3-
"version": "1.0.0-beta.3",
3+
"version": "1.0.0-beta.4",
44
"description": "A Quasar UI App Extension to display inline markdown",
55
"author": "Hawkeye64 <[email protected]>",
66
"main": "src/index.js",

src/component/QMarkdown.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export default Vue.extend({
223223
return val === void 0 || val === false
224224
},
225225

226-
__buildTocTree (list) {
226+
makeTree (list) {
227227
let tree = []
228228
let root = null
229229

@@ -331,8 +331,6 @@ export default Vue.extend({
331331

332332
if (this.toc && tocData.length > 0) {
333333
this.$emit('data', tocData)
334-
let tocTree = this.__buildTocTree(tocData)
335-
this.$emit('tree', tocTree)
336334
}
337335

338336
return h('div', {

src/component/markdown.styl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@
160160
.q-markdown--link
161161
color darken($grey-6, 35%)
162162

163-
> p
164-
margin-bottom 0
163+
// > p
164+
// margin-bottom 0
165165

166166
// TODO: ???
167167
&--
@@ -216,7 +216,8 @@
216216
margin-left -4px
217217
margin-right -4px
218218
padding 0 4px
219-
// border-bottom 1px solid lighten($grey-8, .10)
219+
margin-bottom 4px
220+
border-bottom: 2px solid rgba(0,0,0,0.3)
220221

221222
&--table
222223
width fit-content

0 commit comments

Comments
 (0)