npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

js-dynamic-components

v1.1.0

Published

Vue项目开发实现js动态插入自定义组件,基于vue的extend方法实现,实现对vue自定义组件动态管理操作,只需要一个方法,传入对应的参数即可实现自定义组件动态管理

Downloads

18

Readme

安装本项目

npm i js-dynamic-components

项目说明

“js-dynamic-components”在Vue项目开发实现动态插入自定义组件,基于vue2的extend方法实现,实现对vue自定义组件动态管理操作,只需要一个方法,传入对应的参数即可实现自定义组件的动态管理。 使用“js-dynamic-components”可以实现自定义组件的动态管理,实现对自定义组件的动态插入,动态删除,动态更新,动态获取,动态修改,动态销毁等操作。

使用本项目

// 在您的vue组件当中导入npm包
import {Dynamically_insert_components} from 'js-dynamic-components'
// 使用本项目 示例如下 直接调用该方法
Dynamically_insert_components(Assembly,Tvalue,Id)

示例

// 例如 自注册,或者全局注册的自定义组件
import com2 from './Home'
export default {
    components: {
        com2
    },
    data() {
        return {
            data:'数据传值测试1'
        };
    },
    mounted() {
        this.ss()
    },
    methods: {
        ss(){
            Dynamically_insert_components(com1,this.data,"a1")
        }
    },
};

参数说明

| 参数| 参数说明 | |--|--| | 注意 | 使用js-dynamic-components前,需要对自己开发项目进行一次npm i初始化操作(因为基于vue的extend方法实现,需要还原安装vue) | | Assembly | 自定义组件名称,导入即可 | | Tvalue | props传值 ,字符串,数组,对象都可以,子组件props传值参数Transfer_data | | Id | 需要添加vue自定义组件的DOM的id,字符串传入,"id"|