Advertisement
edor

Multiline TextView problem

Aug 31st, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <template>
  2.     <Page class="page">
  3.         <ActionBar class="action-bar" title="Créer une annonce">
  4.         </ActionBar>
  5.        
  6.         <ScrollView>
  7.             <StackLayout class="content">
  8.                 <TextField v-model="annonce.title" hint="Titre de l'annonce" class="input" />
  9.  
  10.                 <TextView height="100" hint="Description de l'annonce"></TextView>
  11.                 <Label text="Appuyez 2 fois sur 'espace' pour faire une nouvelle ligne" class="hint" />
  12.  
  13.                 <Label text="A qui envoyer votre annonce ?" class="label" />
  14.                 <ListPicker :items="listStatus" v-model="userStatus" class="listStatus" />
  15.  
  16.                 <Button class="btn btn-primary" text="Créer mon annonce" @tap="createAnnonce"/>
  17.             </StackLayout>
  18.         </ScrollView>
  19.     </Page>  
  20. </template>
  21.  
  22. <script>
  23. import HomeEmp from './HomeEmp'
  24.  
  25. export default {
  26.     components: {
  27.  
  28.     },
  29.     data() {
  30.       return {
  31.           annonce: {
  32.               title: "",
  33.               details: "",
  34.               typeProfil: "",
  35.           },
  36.           listStatus: [ '1', '2', '3' ],
  37.           userStatus: "",
  38.       };
  39.     },
  40.     computed: {
  41.      
  42.     },
  43.     methods: {
  44.         createAnnonce () {
  45.             console.log('create')
  46.             console.log()
  47.             confirm({
  48.                 title: "Confirmation",
  49.                 message: "Confirm?",
  50.                 okButtonText: "Yes",
  51.                 cancelButtonText: "No"
  52.             }).then(result => {
  53.                 if (result) {
  54.                     alert({
  55.                         title: 'Ok',
  56.                         message: 'Sent!'
  57.                     })
  58.                     .then(() => {
  59.                         this.$navigateTo(HomeEmployeur);
  60.                     });
  61.                 } else {
  62.                     alert({
  63.                         title: 'Envoi canceled',
  64.                         message: 'Not sent'
  65.                     })
  66.                     .then(() => {
  67.                         //console.log("Alert dialog closed.");
  68.                     });
  69.                 }
  70.             });
  71.         },
  72.         handleEnterKeyPress () {
  73.             console.log('ENTER PRESSED')
  74.             this.annonce.details = this.annonce.details.concat("\n");
  75.         },
  76.         tchange (t) {
  77.             var tmp = this.annonce.details;
  78.             this.annonce.details = tmp.replace("  ", "\n");
  79.         }
  80.     }
  81. }
  82. </script>
  83.  
  84. <style scoped>
  85. .label {
  86.     margin-top: 25;
  87. }
  88. .input {
  89.     margin-bottom: 15;
  90. }
  91. .content {
  92.     margin: 20;
  93.     vertical-align: center;
  94. }
  95. .hint {
  96.     font-size: 12;
  97. }
  98. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement