如何在项目中使用vue材质

时间:2018-01-19 11:29:37

标签: vuejs2 vue-material

我正在尝试在我的laravel v.5.5项目中实现vue-material,我已经安装了包,我正在我的import io.appium.java_client.android.AndroidDriver; public class macdjtest { static AndroidDriver driver; Dimension size; int count=0; @Before public void setUp() throws Exception { System.out.println("capabilities creation start........."); DesiredCapabilities capabilities = new DesiredCapabilities(); //capabilities.setCapability("deviceName", "9885f6305856543937"); capabilities.setCapability(CapabilityType.VERSION,"7.0"); capabilities.setCapability("platformName", "Android"); capabilities.setCapability("appPackage","com.androidappname.app"); capabilities.setCapability("appActivity","com.androidappname.app.views.activities.SplashScreenActivity"); capabilities.setCapability("newCommandTimeout", "450000"); capabilities.setCapability("gpsEnabled",true); System.out.println("android driver loading start........."); driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); } @After public void tearDown() throws Exception { driver.quit(); //driver.quit(); } @Test public void test() throws IOException, Exception { System.out.println("Inside the test method"); size = driver.manage().window().getSize(); int startx = (int) (size.width * 0.85); int endx = (int) (size.width * 0.20); int starty = size.height / 2; System.out.println(size); WebDriverWait wait = new WebDriverWait(driver, 240); for(int i=1;i<=10;i=i+1) { driver.resetApp(); System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss:SSS").format(new Date())+" Startsession"); //Selecting wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/sit_url"))); //com.androidappname.app:id/sit_url driver.findElementById("com.androidappname.app:id/sit_url").click(); //System.out.println("Enviorment selected"); //wait.until(ExpectedConditions.elementToBeClickable(By.id("com.android.packageinstaller:id/permission_allow_button"))); //com.android.packageinstaller:id/permission_allow_button //driver.findElementById("com.android.packageinstaller:id/permission_allow_button").click(); wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/txt_title"))); //clicking on the next 3 times System.out.println("Find the text next"); for(int i1=1;i1<=3;i1++) { driver.findElementById("com.androidappname.app:id/txt_next").click(); } System.out.println("Explore as guest"); wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/txt_guest"))); Thread.sleep(500); driver.findElementById("com.androidappname.app:id/txt_guest").click(); System.out.println("Access Granting for the location"); wait.until(ExpectedConditions.elementToBeClickable(By.id("com.android.packageinstaller:id/permission_allow_button"))); driver.findElementById("com.android.packageinstaller:id/permission_allow_button").click(); //com.androidappname.app:id/welcomeText wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/ivYasHeader"))); System.out.println("Home Page Screen"); for(int j=1;j<=4;j++) { System.out.println("Swipe"); driver.swipe(startx, starty, endx, starty, 3000); Thread.sleep(500); } Thread.sleep(500); wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/ivYasHeader"))); driver.findElementById("com.androidappname.app:id/footerYasImage").click(); Thread.sleep(500); wait.until(ExpectedConditions.elementToBeClickable(By.id("android:id/button2"))); driver.findElementById("android:id/button2").click(); //android:id/button2 //sign up option declined wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/whats_on_tv"))); //com.androidappname.app:id/navigation_whatson driver.findElementById("com.androidappname.app:id/navigation_whatson").click(); Thread.sleep(500); wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/whats_on_tv"))); //com.androidappname.app:id/navigation_places Thread.sleep(500); //driver.findElementById("com.androidappname.app:id/navigation_places").click(); //com.androidappname.app:id/text_places_expanded //wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/text_places_expanded"))); //com.androidappname.app:id/navigation_yas_guide driver.findElementById("com.androidappname.app:id/navigation_yas_guide").click(); Thread.sleep(500); //com.androidappname.app:id/image_left_menu_expanded wait.until(ExpectedConditions.elementToBeClickable(By.id("com.androidappname.app:id/icon_menu"))); driver.findElementById("com.androidappname.app:id/icon_menu").click(); Thread.sleep(500); System.out.println("Clicking on menu Icon"); System.out.print(count); } } } 中导入js部分并在我的sass文件中导入css文件,就像它一样在文档中说:

App.js

app.js

App.scss

window.Vue = require('vue');

import VueMaterial from 'vue-material';
Vue.use(VueMaterial);

我正在尝试实施@import '~vue-material/dist/vue-material.min.css'; app componen t只是为了在vue vue-material中对其进行测试:

example-component

然后我在刀片视图中使用这样的组件:

我该如何解决这个问题?

<template>
  <div class="page-container">
    <md-app md-waterfall md-mode="fixed-last">
      <md-app-toolbar class="md-large md-dense md-primary">
        <div class="md-toolbar-row">
          <div class="md-toolbar-section-start">
            <md-button class="md-icon-button" @click="menuVisible = !menuVisible">
              <md-icon>menu</md-icon>
            </md-button>

            <span class="md-title">My Title</span>
          </div>

          <div class="md-toolbar-section-end">
            <md-button class="md-icon-button">
              <md-icon>more_vert</md-icon>
            </md-button>
          </div>
        </div>

        <div class="md-toolbar-row">
          <md-tabs class="md-primary">
            <md-tab id="tab-home" md-label="Home"></md-tab>
            <md-tab id="tab-pages" md-label="Pages"></md-tab>
            <md-tab id="tab-posts" md-label="Posts"></md-tab>
            <md-tab id="tab-favorites" md-label="Favorites"></md-tab>
          </md-tabs>
        </div>
      </md-app-toolbar>

      <md-app-drawer :md-active.sync="menuVisible">
        <md-toolbar class="md-transparent" md-elevation="0">Navigation</md-toolbar>

        <md-list>
          <md-list-item>
            <md-icon>move_to_inbox</md-icon>
            <span class="md-list-item-text">Inbox</span>
          </md-list-item>

          <md-list-item>
            <md-icon>send</md-icon>
            <span class="md-list-item-text">Sent Mail</span>
          </md-list-item>

          <md-list-item>
            <md-icon>delete</md-icon>
            <span class="md-list-item-text">Trash</span>
          </md-list-item>

          <md-list-item>
            <md-icon>error</md-icon>
            <span class="md-list-item-text">Spam</span>
          </md-list-item>
        </md-list>
      </md-app-drawer>

      <md-app-content>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
      </md-app-content>
    </md-app>
  </div>
</template>
<script>
export default {
  data: () => ({
    menuVisible: false
  })
}
</script>

但是,导航器根本没有固定,抽屉不工作,我做错了什么?

0 个答案:

没有答案