Git Product home page Git Product logo

eggjs-youtobe-frontend's Introduction

egg-youtobe-frontend

Customize configuration

See Configuration Reference.

shims-vue.d.ts

declare module '*.vue' {
  import type { DefineComponent } from 'vue'
  const component: DefineComponent<{}, {}, any>
  export default component
}
  • 是什么? ===> typescript 中的 类型声明文件
  • 为什么? ===> 加载.vue文件的时候, TS 编译器 不知道它的类型是什么?
  • 怎么做? ===> 在根目录下创建shims-vue.d.ts文件
  • 什么用? ===> 所有以.vue结尾的文件模块, 它的类型就是这里导出的类型(componenet), 这个componenet 对应的就是 DefineComponent, 来自于Vue本身. 这样在加载vue组件的时候,typescript才能正确的识别出它的类型

配置不同环境的变量

  • .env.development: npm run serve 加载的环境变量配置文件
  • .env.production: npm run build 加载的环境变量配置文件
  • 配置的变量名称以VUE_APP_开头: VUE_APP_API_BASE_URL=http://127.0.0.1:7001

TypeScript for Vuex

  1. Define the typed InjectionKey
  2. Provide the typed InjectionKey when installing a store to the Vue app
  3. Pass the typed InjectionKey to the useStore method

下载视频SDK

  • 放置到public目录下
  • index.html中引入SDK
<script src="/aliyun-upload-sdk-1.5.2/lib/aliyun-oss-sdk-6.13.0.min.js"></script>
<script src="/aliyun-upload-sdk-1.5.2/lib/es6-promise.min.js"></script>
<script src="/aliyun-upload-sdk-1.5.2/aliyun-upload-sdk-1.5.2.min.js"></script>

视频播放

 <!-- 视频播放SDK html5 -->
  <script src="https://g.alicdn.com/de/prismplayer/2.9.3/aliplayer-h5-min.js"></script>
  • 引入样式
 <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.3/skins/default/aliplayer-min.css" />
  • 在播放页面 加入 阿里云播放器初始化容器
<div class="prism-player" id="J_prismPlayer"></div>

[email protected] [email protected]

eggjs-youtobe-frontend's People

Contributors

leslie1943 avatar

Watchers

James Cloos avatar  avatar

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.