Landscape 输入框

Scan me!

用于在浮层中显示广告或说明

引入

  1. import { Landscape } from 'mand-mobile'
  2. Vue.component(Landscape.name, Landscape)

代码演示

示例

  1. <template>
  2. <div class="md-example-child md-example-child-landscape">
  3. <md-button @click="showPic=true">图片广告</md-button>
  4. <md-landscape v-model="showPic">
  5. <img src="//manhattan.didistatic.com/static/manhattan/do1_6VL7HL8TYaUMsIfygfpz">
  6. </md-landscape>
  7. <md-button @click.native="showMaskClosable=true">点击蒙层关闭</md-button>
  8. <md-landscape v-model="showMaskClosable" :mask-closable="true">
  9. <img src="//manhattan.didistatic.com/static/manhattan/do1_6VL7HL8TYaUMsIfygfpz">
  10. </md-landscape>
  11. <md-button @click="showNoMask=true">无蒙层</md-button>
  12. <md-landscape v-model="showNoMask" :has-mask="false">
  13. <img src="//manhattan.didistatic.com/static/manhattan/do1_6VL7HL8TYaUMsIfygfpz">
  14. </md-landscape>
  15. <md-button @click="showScroll=true">滚动区域</md-button>
  16. <md-landscape v-model="showScroll" :scroll="true">
  17. <div class="scroll-area">
  18. <h1>滚动区域</h1>
  19. <p v-for="i in 20" :key="i">第{{i}}行</p>
  20. </div>
  21. </md-landscape>
  22. <md-button @click="showListen=true">监听事件</md-button>
  23. <md-landscape v-model="showListen" @show="alert('已弹出')" @hide="alert('已隐藏')">
  24. <img src="//manhattan.didistatic.com/static/manhattan/do1_6VL7HL8TYaUMsIfygfpz">
  25. </md-landscape>
  26. </div>
  27. </template>
  28. <script>
  29. import {Landscape, Toast, Button} from 'mand-mobile'
  30. export default {
  31. name: 'landscape-demo',
  32. components: {
  33. [Landscape.name]: Landscape,
  34. [Button.name]: Button,
  35. },
  36. data() {
  37. return {
  38. showPic: false,
  39. showNoMask: false,
  40. showScroll: false,
  41. showListen: false,
  42. showMaskClosable: false,
  43. }
  44. },
  45. methods: {
  46. alert(msg) {
  47. Toast.succeed(msg)
  48. },
  49. },
  50. }
  51. </script>
  52. <style lang="stylus">
  53. .md-example-child-landscape {
  54. .md-button {
  55. margin-bottom: 20px;
  56. }
  57. .content {
  58. background: #f;
  59. }
  60. .scroll-area {
  61. padding: 40px;
  62. color: #6;
  63. h1 {
  64. margin-bottom: 40px;
  65. }
  66. p {
  67. margin: 20px;
  68. }
  69. }
  70. }
  71. </style>
  72.  

API

Landscape Props

属性说明类型默认值
v-model是否展示Booleanfalse
has-mask是否有蒙层Booleantrue
scroll内容区域是否可以滚动Booleanfalse
mask-closable是否可以通过点击蒙层关闭Booleanfalse

Landscape Events

@show()

弹出层展示事件

@hide()

弹出层隐藏事件