GithubHelp home page GithubHelp logo

jsweeta / dynamic-form Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 1.73 MB

学习前端工程化的地方,其中包括rollup,webpack,组件库的封装,动态表单的封装,工程化的构建

Vue 19.26% TypeScript 47.11% HTML 2.26% Shell 0.73% JavaScript 30.64%

dynamic-form's People

Contributors

hygag avatar jsweeta avatar

Stargazers

 avatar  avatar  avatar

Forkers

cagancosan

dynamic-form's Issues

前端模块化资料补充以及使用场景

前端模块化

MDN JavaScript模块化
https://www.cnblogs.com/echoyya/p/14577243.html

CommonJS

nodejs所应用的模块化方案。

CommonJS规范](https://wiki.commonjs.org/wiki/Modules/1.1)

AMD诞生的背景

在正常的服务器环境下,单纯只靠CommonJs基本上就够了,因为资源都在服务器的硬盘上,加载文件的快慢单纯就算磁盘读写速度决定的,但是对于浏览器环境的话,一个模块的加载是需要通过网络的,等待时间取决于网速的快慢,可能需要等很长时间,因此,AMD诞生了——异步模块定义。

打包分包的话,别人改如何引用

问题的原因是分包后的文件命名是 [name]-[hash].[ext],这样就导致了打包后的文件名会变化
而如下引用时

import xxx from '@/xxx'

这个入口是由package.json内的main,module等这些字段控制的,如果进行分包的话,这些main,module字段怎样设置,怎样实时改动。

工程化工具的文档导航

关于.d.ts作用范围和tsconfig.json作用范围的问题

当在根目录的 .d.ts 文件中声明 @monorepo/utils 时,它并不会自动地在 src 目录下的 index.vue 文件中生效。这是因为 TypeScript 默认只会解析与当前文件相同目录或子目录下的 .d.ts 文件。

要使根目录的 .d.ts 文件中的声明在 src 目录下的 index.vue 文件中生效,你可以采取以下几种方式:

  1. 使用相对路径引入:在 index.vue 文件中使用相对路径引入根目录的 .d.ts 文件。例如,如果根目录的 .d.ts 文件名为 global.d.ts,可以在 index.vue 文件中添加以下引入语句:
import '@/global.d.ts';

这样,根目录的 .d.ts 文件中的声明就会在 index.vue 文件中生效。

  1. 配置 TypeScript 编译选项:在 TypeScript 配置文件 tsconfig.json 中,可以将根目录的 .d.ts 文件包含到编译过程中。在 tsconfig.json 文件的 include 字段中添加根目录的 .d.ts 文件的路径。例如:
{
  "compilerOptions": {
    // ...
  },
  "include": [
    "src",
    "global.d.ts"
  ]
}

这样,根目录的 .d.ts 文件中的声明也会在 src 目录下的文件中生效。

  1. .d.ts 文件放置在与 index.vue 同级的目录:将根目录的 .d.ts 文件放置在与 index.vue 同级的目录中,这样它会被默认解析并在 index.vue 文件中生效。

请注意,以上方法只是使根目录的 .d.ts 文件中的声明在 index.vue 文件中生效的一些常见方式。具体的解决方法可能会因项目结构和配置而有所不同。

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.