Code Monkey home page Code Monkey logo

devextreme-vue-template's Introduction

devextreme-vue-template

The DevExtreme Vue Template allows you to create an application with several views and a hierarchical menu (see the live preview).

DevExtreme-Vue-Template

You can use DevExtreme CLI commands to modify, add, and delete views, configure the menu, and change themes.

The DevExtreme Vue Template is based on DevExtreme Vue components and generated with Vue CLI.

Getting Started

Use the DevExtreme CLI's new vue-app command to create a DevExtreme Vue application that includes several sample views and a navigation menu:

npx devextreme-cli new vue-app app-name
cd app-name
npm run serve

The application includes a side navigation menu and an outer toolbar.

Outer Toolbar Layout

You can set the --layout option to side-nav-inner-toolbar to use the layout with an inner toolbar.

npx devextreme-cli new vue-app app-name --layout=side-nav-inner-toolbar

Inner Toolbar Layout

Use the --empty flag to generate an application without views and navigation items.

npx devextreme-cli new vue-app app-name --empty

You can also clone the current repository to configure the DevExtreme Vue Template.

git clone https://github.com/DevExpress/devextreme-vue-template/
cd devextreme-vue-template
npm install
npm run serve

Switch the Layout

You can change the layout in an existing application. For this, substitute the ./layouts/side-nav-outer-toolbar import path with ./layouts/side-nav-inner-toolbar in the src/router.js file.

import defaultLayout from './layouts/side-nav-inner-toolbar'

Add a View

Use the following command to add a view to a DevExtreme Vue application based on the current template:

npx devextreme add view view-name [--icon=IconName]

You can choose the icon name from the icon library.

The add view command also creates a root navigation item for the view.

Refer to the Widget Gallery for examples of using DevExtreme widgets in Vue.

Configure Navigation Items

Use the src\app-navigation.js file to configure navigation items. Each configuration item can have the following fields:

  • text - an item text
  • icon - an item icon
  • path - a navigation path associated with an item
  • items - child items
{
    text: 'Category',
    icon: 'folder',
    items: [{
        text: 'About',
        path: '/about'
    }]
}

Customize Application Appearance

Change Theme

The DevExtreme Vue Template uses different themes for its content and menu. Pass the theme's name to the base-theme option in the metadata.base.json and metadata.additional.json files in the src\themes folder to modify the content and menu themes. See Predefined Themes for more information.

{
    // ...,
    "baseTheme": "material.teal.light",
    // ...
}

Run npm run build-themes to rebuild themes.

Create a Custom Theme

You can use the DevExtreme Theme Builder to create a custom theme based on predefined themes. For this, import src\themes\metadata.base.json or src\themes\metadata.additional.json into the Theme Builder, modify the theme, and export the result to the initial file.

Run npm run build to rebuild themes.

Apply the Additional Theme to a Custom Element

Add the dx-swatch-additional class to a DOM node to apply the additional (menu) theme to this node.

<div class="dx-swatch-additional">
    <!-- Your content here -->
</div>

Apply Theme Variables to Custom Elements

You can apply the SCSS variables defined in variables.base.scss and variables.additional.scss to custom elements.

// Your scss
@import "../../../themes/generated/variables.base.scss";

.my-element {
    background-color: $base-accent;
}

License

Familiarize yourself with the DevExtreme License. Free trial is available!

DevExtreme Vue Template is released as a MIT-licensed (free and open-source) add-on to DevExtreme.

devextreme-vue-template's People

Contributors

nightskylark avatar ilyakhd avatar dxvladislavvolkov avatar bingorus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.