Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye64 committed Apr 22, 2019
2 parents ec78291 + c3fe2b6 commit 9bb758d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ and finally:
| Vue Event | Description |
|---|---|
| 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 |
| 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 |

Given markdown that looks like this:
```
Expand All @@ -114,13 +113,28 @@ Given markdown that looks like this:
The TOC data looks like this:
```
[
{id: 'h2-Heading', title: 'h2 Heading', level: 2},
{id: 'h3-Heading', title: 'h3 Heading', level: 3}
{id: 'h2-Heading', title: 'h2 Heading', level: 2, children: []},
{id: 'h3-Heading', title: 'h3 Heading', level: 3, children: []}
]
```

# QMarkdown Vue Methods
| Vue Method | Description |
|---|---|
| makeTree | Pass into this function the results from the @data to have the data array transformed into a hieracrhial tree. |

The TOC data will be transformed to the following:
```
[
{id: 'h2-Heading', title: 'h2 Heading', level: 2, children: [
{id: 'h3-Heading', title: 'h3 Heading', level: 3, children: []}
]}
]
```

# QMarkdown Vue Slots
| Vue Property | Description |
| Vue Slot | Description |
|---|---|
| default | The default slot - this slot overrides anything that may be passed in via the `src` property. |

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quasar/quasar-app-extension-qmarkdown",
"version": "1.0.0-beta.3",
"version": "1.0.0-beta.4",
"description": "A Quasar UI App Extension to display inline markdown",
"author": "Hawkeye64 <[email protected]>",
"main": "src/index.js",
Expand Down
4 changes: 1 addition & 3 deletions src/component/QMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export default Vue.extend({
return val === void 0 || val === false
},

__buildTocTree (list) {
makeTree (list) {
let tree = []
let root = null

Expand Down Expand Up @@ -331,8 +331,6 @@ export default Vue.extend({

if (this.toc && tocData.length > 0) {
this.$emit('data', tocData)
let tocTree = this.__buildTocTree(tocData)
this.$emit('tree', tocTree)
}

return h('div', {
Expand Down
7 changes: 4 additions & 3 deletions src/component/markdown.styl
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@
.q-markdown--link
color darken($grey-6, 35%)

> p
margin-bottom 0
// > p
// margin-bottom 0

// TODO: ???
&--
Expand Down Expand Up @@ -216,7 +216,8 @@
margin-left -4px
margin-right -4px
padding 0 4px
// border-bottom 1px solid lighten($grey-8, .10)
margin-bottom 4px
border-bottom: 2px solid rgba(0,0,0,0.3)

&--table
width fit-content
Expand Down

0 comments on commit 9bb758d

Please sign in to comment.