audio

首次使用weexplus plugin add https://github.com/farwolf2010/office

api

demo

  1. <template>
  2. <div style="align-items: center;justify-content: center">
  3. <div style="width: 700px;height: 1100px;background-color: #eeeeee">
  4. <office style="flex: 1" :src="src">
  5. </office>
  6. </div>
  7. <div style="flex-direction: row" >
  8. <button text="加载http" @click="loadhttp"></button>
  9. <button text="加载本地" @click="loadlocal"></button>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default{
  15. props: {},
  16. data(){
  17. return {
  18. src:''
  19. }
  20. },
  21. methods: {
  22. loadhttp(){
  23. this.src= 'http://59.110.169.246/img/1.docx'
  24. },
  25. loadlocal(){
  26. let url='http://59.110.169.246/img/book.pdf'
  27. let net=weex.requireModule('net')
  28. net.download(url,(res)=>{
  29. this.log(res)
  30. },(res)=>{
  31. this.log(res)
  32. this.src=res.path
  33. },()=>{
  34. })
  35. },
  36. onLoad(p){
  37. }
  38. },
  39. created(){
  40. }
  41. }
  42. </script>
  43. <style scoped>
  44. </style>