image


图片

示例

  1. <template>
  2. <page title="image演示">
  3. <view class="container">
  4. <image src="{{imageSrc}}" style="width: 682cpx;height:600cpx;" c-bind:onload="imageLoad" c-bind:onerror="imageError"></image>
  5. </view>
  6. </page>
  7. </template>
  8. <script>
  9. class Image {
  10. data = {
  11. imageSrc: require('../../assets/images/chameleon.png')
  12. }
  13. methods = {
  14. imageLoad(e) {
  15. console.log(e);
  16. },
  17. imageError(e) {}
  18. }
  19. }
  20. export default new Image()
  21. </script>
  22. <style scoped>
  23. .container {
  24. display: flex;
  25. flex-direction: column;
  26. align-items: center;
  27. }
  28. </style>
  29. <script cml-type="json">
  30. {
  31. "base": {}
  32. }
  33. </script>