Last active
January 13, 2017 07:06
-
-
Save toast38coza/6d1d8ae604c9653e6b1b7cf3f8c74d8d to your computer and use it in GitHub Desktop.
Quickstart Framework7-vue setup for a typical VueJS webpack project
This file contains hidden or 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
| <template> | |
| <!-- App --> | |
| <div id="app"> | |
| <!-- Statusbar --> | |
| <f7-statusbar></f7-statusbar> | |
| <!-- Left Panel --> | |
| <f7-panel left reveal layout="dark"> | |
| <f7-view id="left-panel-view" navbar-through :dynamic-navbar="true"> | |
| <f7-navbar title="Left Panel"></f7-navbar> | |
| <f7-pages> | |
| <f7-page> | |
| <f7-block inner> | |
| <p>Left panel content goes here</p> | |
| </f7-block> | |
| <f7-block-title>Load page in panel</f7-block-title> | |
| <f7-list> | |
| <f7-list-item link="/about/" title="About"></f7-list-item> | |
| <f7-list-item link="/form/" title="Form"></f7-list-item> | |
| </f7-list> | |
| <f7-block-title>Load page in main view</f7-block-title> | |
| <f7-list> | |
| <f7-list-item link="/about/" title="About" link-view="#main-view" link-close-panel></f7-list-item> | |
| <f7-list-item link="/form/" title="Form" link-view="#main-view" link-close-panel></f7-list-item> | |
| </f7-list> | |
| </f7-page> | |
| </f7-pages> | |
| </f7-view> | |
| </f7-panel> | |
| <!-- Right Panel --> | |
| <f7-panel right cover layout="dark"> | |
| <f7-view id="right-panel-view" navbar-through :dynamic-navbar="true"> | |
| <f7-navbar title="Right Panel" sliding></f7-navbar> | |
| <f7-pages> | |
| <f7-page> | |
| <f7-block> | |
| <p>Right panel content goes here</p> | |
| </f7-block> | |
| <f7-block-title>Load page in panel</f7-block-title> | |
| <f7-list> | |
| <f7-list-item link="/about/" title="About"></f7-list-item> | |
| <f7-list-item link="/form/" title="Form"></f7-list-item> | |
| </f7-list> | |
| <f7-block-title>Load page in main view</f7-block-title> | |
| <f7-list> | |
| <f7-list-item link="/about/" title="About" link-view="#main-view" link-close-panel></f7-list-item> | |
| <f7-list-item link="/form/" title="Form" link-view="#main-view" link-close-panel></f7-list-item> | |
| </f7-list> | |
| </f7-page> | |
| </f7-pages> | |
| </f7-view> | |
| </f7-panel> | |
| <!-- Main Views --> | |
| <f7-views> | |
| <f7-view id="main-view" navbar-through :dynamic-navbar="true" main> | |
| <!-- Navbar --> | |
| <f7-navbar> | |
| <f7-nav-left> | |
| <f7-link icon="icon-bars" open-panel="left"></f7-link> | |
| </f7-nav-left> | |
| <f7-nav-center sliding>Framework7</f7-nav-center> | |
| <f7-nav-right> | |
| <f7-link icon="icon-bars" open-panel="right"></f7-link> | |
| </f7-nav-right> | |
| </f7-navbar> | |
| <!-- Pages --> | |
| <f7-pages> | |
| <f7-page> | |
| <f7-block-title>Welcome to my App</f7-block-title> | |
| <f7-block inner> | |
| <p>Duis sed erat ac eros ultrices pharetra id ut tellus. Praesent rhoncus enim ornare ipsum aliquet ultricies. Pellentesque sodales erat quis elementum sagittis.</p> | |
| </f7-block> | |
| <f7-block-title>Navigation</f7-block-title> | |
| <f7-list> | |
| <f7-list-item link="/about/" title="About"></f7-list-item> | |
| <f7-list-item link="/form/" title="Form"></f7-list-item> | |
| <f7-list-item link="/dynamic-route/blog/45/post/125/?foo=bar#about" title="Dynamic Route"></f7-list-item> | |
| </f7-list> | |
| <f7-block-title>Side Panels</f7-block-title> | |
| <f7-block> | |
| <f7-grid> | |
| <f7-col width="50"> | |
| <f7-button open-panel="left">Left Panel</f7-button> | |
| </f7-col> | |
| <f7-col width="50"> | |
| <f7-button open-panel="right">Right Panel</f7-button> | |
| </f7-col> | |
| </f7-grid> | |
| </f7-block> | |
| <f7-block-title>Modals</f7-block-title> | |
| <f7-block> | |
| <f7-grid> | |
| <f7-col width="50"> | |
| <f7-button open-popup="#popup">Popup</f7-button> | |
| </f7-col> | |
| <f7-col width="50"> | |
| <f7-button open-login-screen="#login-screen">Login Screen</f7-button> | |
| </f7-col> | |
| </f7-grid> | |
| </f7-block> | |
| </f7-page> | |
| </f7-pages> | |
| </f7-view> | |
| </f7-views> | |
| <!-- Popup --> | |
| <f7-popup id="popup"> | |
| <f7-view navbar-fixed> | |
| <f7-pages> | |
| <f7-page> | |
| <f7-navbar title="Popup"> | |
| <f7-nav-right> | |
| <f7-link close-popup>Close</f7-link> | |
| </f7-nav-right> | |
| </f7-navbar> | |
| <f7-block>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque, architecto. Cupiditate laudantium rem nesciunt numquam, ipsam. Voluptates omnis, a inventore atque ratione aliquam. Omnis iusto nemo quos ullam obcaecati, quod.</f7-block> | |
| </f7-page> | |
| </f7-pages> | |
| </f7-view> | |
| </f7-popup> | |
| <!-- Login Screen --> | |
| <f7-login-screen id="login-screen"> | |
| <f7-view> | |
| <f7-pages> | |
| <f7-page login-screen> | |
| <f7-login-screen-title>Login</f7-login-screen-title> | |
| <f7-list form> | |
| <f7-list-item> | |
| <f7-label>Username</f7-label> | |
| <f7-input name="username" placeholder="Username" type="text"></f7-input> | |
| </f7-list-item> | |
| <f7-list-item> | |
| <f7-label>Password</f7-label> | |
| <f7-input name="password" type="password" placeholder="Password"></f7-input> | |
| </f7-list-item> | |
| </f7-list> | |
| <f7-list> | |
| <f7-list-button title="Sign In" close-login-screen></f7-list-button> | |
| <f7-list-label> | |
| <p>Click Sign In to close Login Screen</p> | |
| </f7-list-label> | |
| </f7-list> | |
| </f7-page> | |
| </f7-pages> | |
| </f7-view> | |
| </f7-login-screen> | |
| </div> | |
| </template> | |
| <script> | |
| export default {} | |
| </script> |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>f7</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui"> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <meta name="apple-mobile-web-app-status-bar-style" content="black"> | |
| </head> | |
| <body> | |
| <div id="app"></div> | |
| <!-- built files will be auto injected --> | |
| </body> | |
| </html> |
This file contains hidden or 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
| // The Vue build version to load with the `import` command | |
| // (runtime-only or standalone) has been set in webpack.base.conf with an alias. | |
| import Vue from 'vue' | |
| // Import F7 | |
| /* eslint-disable no-unused-vars */ | |
| import Framework7 from 'framework7' | |
| // Import F7 Vue Plugin | |
| import Framework7Vue from 'framework7-vue' | |
| // Import F7 iOS Theme Styles | |
| /* eslint-disable no-unused-vars */ | |
| import Framework7Theme from 'framework7/dist/css/framework7.ios.min.css' | |
| import Framework7ThemeColors from 'framework7/dist/css/framework7.ios.colors.min.css' | |
| /* OR for Material Theme: | |
| import Framework7Theme from 'framework7/dist/css/framework7.material.min.css' | |
| import Framework7ThemeColors from 'framework7/dist/css/framework7.material.colors.min.css' | |
| */ | |
| // Import App Custom Styles | |
| // import AppStyles from './css/app.css' | |
| // Import Routes | |
| import Routes from './routes.js' | |
| import App from './App' | |
| // Init F7 Vue Plugin | |
| Vue.use(Framework7Vue) | |
| /* eslint-disable no-new */ | |
| // Init App | |
| new Vue({ | |
| el: '#app', | |
| template: '<app/>', | |
| // Init Framework7 by passing parameters here | |
| framework7: { | |
| root: '#app', | |
| /* Uncomment to enable Material theme: */ | |
| // material: true, | |
| routes: Routes | |
| }, | |
| // Register App Component | |
| components: { | |
| app: App | |
| } | |
| }) |
This file contains hidden or 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
| export default [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment