3shape-global-nav 中文文档教程

发布于 3年前 浏览 25 更新于 3年前

3shape-global-nav

How to use

安装包

npm i 3shape-global-nav @webcomponents/webcomponentsjs

添加 polyfill 导入

import '@webcomponents/webcomponentsjs/webcomponents-bundle.js';
// or dynamical
import '@webcomponents/webcomponentsjs/webcomponents-loader.js';

添加组件导入

import '3shape-global-nav';

使用 tag

<g-navigation
    env="{env}"
    username="{userName}"
    token="{token}"
    logouturl="{logoutUrl}"
></g-navigation>

Props

PropTypeDefaultDescription
{env}Stringnullcurrent environment. available options: 'test', 'staging', 'production'
{userName}Stringnullshows user name in account menu
{token}Stringnullthe same as {userName}. component decodes token for you and gets userName from it. if you specify {userName} - {token} will not work
{logoutUrl}Stringnulllink to logout page

How to develop

npm i
npm run watch
npm run serve

访问 http://localhost:8000

3shape-global-nav

How to use

Install packages

npm i 3shape-global-nav @webcomponents/webcomponentsjs

Add polyfill import

import '@webcomponents/webcomponentsjs/webcomponents-bundle.js';
// or dynamical
import '@webcomponents/webcomponentsjs/webcomponents-loader.js';

Add component import

import '3shape-global-nav';

Use tag

<g-navigation
    env="{env}"
    username="{userName}"
    token="{token}"
    logouturl="{logoutUrl}"
></g-navigation>

Props

PropTypeDefaultDescription
{env}Stringnullcurrent environment. available options: 'test', 'staging', 'production'
{userName}Stringnullshows user name in account menu
{token}Stringnullthe same as {userName}. component decodes token for you and gets userName from it. if you specify {userName} - {token} will not work
{logoutUrl}Stringnulllink to logout page

How to develop

npm i
npm run watch
npm run serve

Go to http://localhost:8000

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文