This repository has been archived by the owner on Jul 12, 2020. It is now read-only.
forked from yuche/vue-strap
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The header now supports markdown parsing, making it consistent with MarkBind’s rich formatting for headers. The old box component’s header style can be improved to support Markdown headers.
- Loading branch information
Showing
3 changed files
with
162 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div v-if="dev"> | ||
<div style="font-size: 1.5em; font-weight: bold;"> | ||
StyleSwitcher | ||
<br/> | ||
<span style="font-size: 0.67em;">Refresh the page to see the default style again</span> | ||
</div> | ||
<button @click="increaseIndex"> | ||
Increase | ||
</button> | ||
<button @click="decreaseIndex"> | ||
Decrease | ||
</button> | ||
<input | ||
v-model="index" | ||
type="text" | ||
placeholder="1 to 16 (press enter)" | ||
@change="changeStylesheet" /> | ||
Current: {{ index }} | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
dev: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
index: 0, | ||
bootstrapThemeLink: null, | ||
bootstrapExtraThemeLink: null, | ||
}; | ||
}, | ||
methods: { | ||
changeStylesheet() { | ||
this.bootstrapThemeLink.attr('href', `markbind/dev/css/bootswatch/${this.index}/bootstrap.min.css`); | ||
// eslint-disable-next-line max-len | ||
this.bootstrapExtraThemeLink.attr('href', `markbind/dev/css/bootswatchExtras/${this.index}/bootstrap-markbind.css`); | ||
}, | ||
increaseIndex() { | ||
this.index += 1; | ||
this.changeStylesheet(); | ||
}, | ||
decreaseIndex() { | ||
this.index -= 1; | ||
this.changeStylesheet(); | ||
}, | ||
}, | ||
mounted() { | ||
// eslint-disable-next-line no-undef | ||
this.bootstrapThemeLink = jQuery('link[href="markbind/css/bootstrap.min.css"]'); | ||
// eslint-disable-next-line no-undef | ||
this.bootstrapExtraThemeLink = jQuery('link[href="markbind/css/bootstrap-markbind.css"]'); | ||
}, | ||
}; | ||
</script> |