JSPM

@longhongguo/component-antdv-upload

3.2.40
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32
  • Score
    100M100P100Q67679F
  • License MIT

@form-create/ant-design-vue 内置组件

Package Exports

  • @longhongguo/component-antdv-upload
  • @longhongguo/component-antdv-upload/dist/index.css
  • @longhongguo/component-antdv-upload/dist/index.esm.js
  • @longhongguo/component-antdv-upload/src/index
  • @longhongguo/component-antdv-upload/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@longhongguo/component-antdv-upload) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@longhongguo/component-antdv-upload

@form-create/ant-design-vue 内置组件

GitHub | 文档 | Document

安装

npm install @longhongguo/component-antdv-upload

使用

直接从源码导入(需要配置 webpack)

如果你从 src/index 导入,需要在 webpack 配置中处理 JSX 文件:

Vue CLI (vue.config.js):

module.exports = {
  transpileDependencies: ['@longhongguo/component-antdv-upload']
}

Webpack 配置:

module.exports = {
  module: {
    rules: [
      {
        test: /\.jsx$/,
        include: /node_modules\/@longhongguo\/component-antdv-upload/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@vue/cli-plugin-babel/preset'],
            plugins: ['@vue/babel-plugin-jsx']
          }
        }
      }
    ]
  }
}

使用构建后的文件(推荐)

使用构建后的文件,无需额外配置:

import upload from '@longhongguo/component-antdv-upload/dist/index.esm.js'
// 引入样式文件(必需)
import '@longhongguo/component-antdv-upload/dist/index.esm.css'
// 或
import upload from '@longhongguo/component-antdv-upload'
import '@longhongguo/component-antdv-upload/dist/index.css'

样式引入

重要:使用构建后的文件时需要手动引入样式文件

样式用于禁用上传组件的动画效果,必须引入才能正常工作:

// ESM 格式
import '@longhongguo/component-antdv-upload/dist/index.esm.css'
// 或 UMD 格式
import '@longhongguo/component-antdv-upload/dist/index.css'

如果从 src 导入,样式会被 webpack 自动处理(如果配置了 CSS loader)。

注意事项

  • 该包包含 src 目录(源文件)和 dist 目录(构建文件)
  • 如果从 src 导入,需要配置 webpack/babel 处理 JSX 和 CSS
  • 建议使用构建后的文件(dist/index.esm.js)以避免配置问题
  • 使用构建后的文件时,记得引入对应的 CSS 文件