File tree Expand file tree Collapse file tree 5 files changed +16
-8
lines changed
src/core/components/mdTheme Expand file tree Collapse file tree 5 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 11< section >
22 < h2 class ="md-headline ">
3- < a href ="https://vuematerial.github.io/releases/v0.5.0/ "> v0.5.0 - New Grid System Engine!</ a >
3+ < a href ="https://vuematerial.github.io/ "> v0.5.0 - New Grid System Engine!</ a >
44 </ h2 >
55
66 < h3 class ="md-title "> New Components:</ h3 >
Original file line number Diff line number Diff line change 125125 this .availableDocs = versions;
126126 },
127127 setCurrentByLocation () {
128- let normalizedPathname = location .pathname .replace (/ \/ | v/ g , ' ' );
128+ let normalizedPathname = location .pathname .replace (/ \/ | releases \/ v/ g , ' ' );
129129
130130 if (normalizedPathname && this .availableDocs .indexOf (normalizedPathname) >= 0 ) {
131131 this .currentDocs = normalizedPathname;
Original file line number Diff line number Diff line change 102102 <code-block lang =" javascript" >
103103 Vue.material.setCurrentTheme('about')
104104 </code-block >
105+ Or inside a Vue instance:
106+ <code-block lang =" javascript" >
107+ this.$material.setCurrentTheme('about')
108+ </code-block >
105109 </section >
106110
107111 <section >
Original file line number Diff line number Diff line change @@ -157,4 +157,6 @@ export default function install(Vue) {
157157 } ) ;
158158
159159 Vue . component ( 'md-theme' , MdTheme ) ;
160+
161+ Vue . prototype . $material = Vue . material ;
160162}
Original file line number Diff line number Diff line change 1- import Vue from 'vue' ;
2-
31export default {
42 props : {
53 mdTheme : String
@@ -29,17 +27,21 @@ export default {
2927 let theme = this . closestThemedParent . mdTheme ;
3028
3129 if ( ! theme ) {
32- theme = this . closestThemedParent . mdName ;
30+ if ( this . closestThemedParent ) {
31+ theme = this . closestThemedParent . mdName ;
32+ } else {
33+ theme = this . $material . currentTheme ;
34+ }
3335 }
3436
35- return 'md-theme-' + ( theme || Vue . material . currentTheme ) ;
37+ return 'md-theme-' + theme ;
3638 }
3739 } ,
3840 mounted ( ) {
3941 this . closestThemedParent = this . getClosestThemedParent ( this . $parent ) ;
4042
41- if ( ! Vue . material . currentTheme ) {
42- Vue . material . setCurrentTheme ( 'default' ) ;
43+ if ( ! this . $ material. currentTheme ) {
44+ this . $ material. setCurrentTheme ( 'default' ) ;
4345 }
4446 }
4547} ;
You can’t perform that action at this time.
0 commit comments