Kaynağa Gözat

example: update Vue2 example (#3802)

Antoine du Hamel 2 yıl önce
ebeveyn
işleme
91e08c191f

+ 8 - 18
examples/vue/README.md

@@ -1,21 +1,11 @@
-# uppy-vue
+# Vue 2 example
 
-## Project setup
+You’re browsing the documentation for Vue v2.x and earlier. Check out
+[Vue 3 example](../vue3/) for new projects.
 
-    npm install
+To run the example, from the root directory of this repo, run the following commands:
 
-### Compiles and hot-reloads for development
-
-    npm run serve
-
-### Compiles and minifies for production
-
-    npm run build
-
-### Lints and fixes files
-
-    npm run lint
-
-### Customize configuration
-
-See [Configuration Reference](https://cli.vuejs.org/config/).
+```sh
+corepack yarn install
+corepack yarn workspace @uppy-example/vue2 dev
+```

+ 0 - 5
examples/vue/babel.config.js

@@ -1,5 +0,0 @@
-module.exports = {
-  presets: [
-    '@vue/cli-plugin-babel/preset',
-  ],
-}

+ 13 - 0
examples/vue/index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <link rel="icon" href="/favicon.ico" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>Vite App</title>
+  </head>
+  <body>
+    <div id="app"></div>
+    <script type="module" src="/src/main.js"></script>
+  </body>
+</html>

+ 13 - 15
examples/vue/package.json

@@ -1,26 +1,24 @@
 {
-  "name": "@uppy-example/vue-example",
+  "name": "@uppy-example/vue2",
   "version": "0.0.0",
   "private": true,
   "scripts": {
-    "start": "vue-cli-service serve",
-    "build": "vue-cli-service build",
-    "lint": "vue-cli-service lint"
+    "dev": "vite",
+    "build": "vite build",
+    "preview": "vite preview --port 5050"
   },
   "dependencies": {
+    "@uppy/core": "workspace:*",
+    "@uppy/dashboard": "workspace:*",
+    "@uppy/drag-drop": "workspace:*",
+    "@uppy/progress-bar": "workspace:*",
+    "@uppy/transloadit": "workspace:*",
     "@uppy/vue": "workspace:*",
-    "core-js": "^3.6.5",
-    "shallow-equal": "^1.2.1",
     "vue": "^2.6.14"
   },
   "devDependencies": {
-    "@vue/cli-plugin-babel": "~4.5.0",
-    "@vue/cli-service": "~4.5.0",
-    "vue-template-compiler": "^2.6.11"
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions",
-    "not dead"
-  ]
+    "vite": "^2.7.1",
+    "vite-plugin-vue2": "^2.0.1",
+    "vue-template-compiler": "^2.6.14"
+  }
 }

+ 0 - 1
examples/vue/src/App.vue

@@ -1,6 +1,5 @@
 <template>
   <div id="app">
-    <!-- <HelloWorld msg="Welcome to Uppy Vue Demo"/> -->
     <h1>Welcome to Uppy Vue Demo!</h1>
     <h2>Inline Dashboard</h2>
     <label>

+ 0 - 58
examples/vue/src/components/HelloWorld.vue

@@ -1,58 +0,0 @@
-<template>
-  <div class="hello">
-    <h1>{{ msg }}</h1>
-    <p>
-      For a guide and recipes on how to configure / customize this project,<br>
-      check out the
-      <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
-    </p>
-    <h3>Installed CLI Plugins</h3>
-    <ul>
-      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
-      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
-    </ul>
-    <h3>Essential Links</h3>
-    <ul>
-      <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
-      <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
-      <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
-      <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
-      <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
-    </ul>
-    <h3>Ecosystem</h3>
-    <ul>
-      <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
-      <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
-      <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
-      <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
-      <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
-    </ul>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'HelloWorld',
-  props: {
-    msg: String
-  }
-}
-</script>
-
-<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style scoped>
-h3 {
-  margin: 40px 0 0;
-}
-ul {
-  list-style-type: none;
-  padding: 0;
-}
-li {
-  display: inline-block;
-  margin: 0 10px;
-}
-a {
-  color: #42b983;
-}
-</style>

+ 7 - 0
examples/vue/vite.config.js

@@ -0,0 +1,7 @@
+import { defineConfig } from 'vite'
+import { createVuePlugin } from 'vite-plugin-vue2'
+
+// https://vitejs.dev/config/
+export default defineConfig({
+  plugins: [createVuePlugin()],
+})

+ 2 - 1
package.json

@@ -121,7 +121,8 @@
     "temp-write": "^5.0.0",
     "tsd": "^0.17.0",
     "typescript": "~4.4",
-    "verdaccio": "^5.1.1"
+    "verdaccio": "^5.1.1",
+    "vue-template-compiler": "workspace:*"
   },
   "scripts": {
     "build:bundle": "yarn node ./bin/build-bundle.mjs",

+ 6 - 0
private/vue-template-compiler/package.json

@@ -0,0 +1,6 @@
+{
+    "name": "vue-template-compiler",
+    "version": "0.0.1",
+    "private": true,
+    "description": "This package is there only to avoid a version conflict in the Vue2 example."
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 460 - 183
yarn.lock


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor