Coder Social home page Coder Social logo

wheel-happyfri's Introduction

wheel-happyfri

这是一个基于Vue2 & Vuex 的在线在线答题“造轮子”项目

项目说明

项目根据vue2-happyfri造轮子而来,代码纯手打,为了再次熟悉vue。在有了wheel-notepad的基础,练习这个项目就简单了。

项目总结

其实应该叫GET到的知识点更好听点!

  • 如果XMLHttpRequest不存在可以使用ActiveXObject来初始异步请求对象;

  • mapState辅助函数,一次性生成三个计算属性。

<script>
  import { mapState } from 'vuex'
  export default {
    computed: mapState({
      itemNum: state => state.itemNum,
      level: state => state.level,
      itemDetail: state => state.itemDetail
    })
  }
</script>
  • 在项目components的itemcontainer.vue里,使用v-if判断存了两个page。通过父组件传入的fatherComponent判断是生成home页面还是item页面。

  • itemcontainer.vue组件中,通过计算属性绑定输入题库数组中的题目和选项,然后通过按钮事件改编题库指针后切换下一题,同时还把所选选项唯一id保存。

  • 项目流程图

flowChart

wheel-happyfri's People

Contributors

szy0syz 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.