Component Missing in Vue.JS Display

I'm facing a challenge with implementing Vue Material on a Vue Router Dashboard page while attempting to store the panel in a separate file. Despite spending the last 2 hours researching this issue, I haven't been able to find a solution. The Vue chrome extension also doesn't provide any insights, ruling out styling as the cause. Interestingly, applying a red background color to the component does work, but the functionality still fails. Please excuse any messy code - I've only been working with Vue for about 3 days.

<template>
    <div class="page-container md-layout-row">
        <md-app>
            <md-app-toolbar class="md-primary">
                <span class="md-title">{{ usernameTitleCase }}</span>
            </md-app-toolbar>
            <PagePanel></PagePanel>
            <md-app-content>
                <div class="user">
                    <h1>{{ user.username }}</h1>
                    <h2>{{ user.customThing }}</h2>
                    <h3>{{ user.id }}</h3>
                </div>
            </md-app-content>
        </md-app>
    </div>
</template>

<script>
    import PagePanel from '@/components/panel.vue';

    export default {
        name: 'Dashboard',
        components: {
            PagePanel
        },
        data() {
            return {}
        },
        computed: {
            usernameTitleCase() {
                const letters = this.user.username.split('');
                letters[0] = letters[0].toUpperCase();
                return letters.join('')
            }
        },
        created() {
            this.user = JSON.parse(localStorage.getItem('user'));
        }
    }
</script>

<style>
    .md-app {
        min-height: 350px;
    }

    .md-drawer {
        width: 230px;
        max-width: calc(100vw - 125px);
    }
</style>

Component File Below:

<template>
    <md-app-drawer md-permanent="full">
        <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>
</template>

<script>
    export default {
        name: 'PagePanel'
    }
</script>

I'm currently not in production mode and there are no errors showing up in the console.

Answer №1

If you take a close look towards the end of this VueMaterial documentation page, you'll find the following information:

Within these examples, there are 3 distinct areas: Toolbar, Drawer, and Content. It's recommended to create them using the specific tags listed below:

  • md-app-toolbar: ...
  • md-app-drawer: ...
  • md-app-content: ...

Any other tag included directly inside the md-app tag will be disregarded. The component specifically searches for these three tags to determine their proper placement.

Luckily, they've recently introduced the capability to utilize slots (source), although it hasn't been officially documented yet – you'd have to refer to merge requests to discover this feature. Here's how you can make use of slots:

<template>
    <div class="page-container md-layout-row">
        <md-app>
            <md-app-toolbar> ... </md-app-toolbar>
            <page-panel slot="md-app-drawer"></page-panel>
            <md-app-content> ... </md-app-content>
        </md-app>
    </div>
</template>

Keep in mind that the value for the slot attribute must align with one of the 3 designated values mentioned above.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What could be causing my Laravel Vue app web page to be blank?

I am facing an issue after installing Vue in Laravel and running the command npm run watch with php artisan serve. When I load the page, nothing appears without any error messages. What could be causing this problem? main.js import { createApp } from &apo ...

What could be causing my external JavaScript file to not function properly upon loading my HTML file?

I have organized my code by separating the HTML and JavaScript portions. The JavaScript code is now in its own separate file and I use 'script' tags to reference it in the HTML file. Within the JavaScript code, I have two functions - one creates ...

How to customize TextField error color in Material-UI using conditional logic in React

Currently, I am incorporating the React Material-UI library into my project and faced with a challenge of conditionally changing the error color of a TextField. My goal is to alter the color of the helper text, border, text, and required marker to yellow ...

Using parseFloat in JavaScript for German number formatting

Currently, I am working on incorporating a Vue.js component that is inspired by the example provided in this link: https://jsfiddle.net/mani04/bgzhw68m/. This is the structure of my source code: computed: { displayValue: { get ...

Icon click does not pass the button's value attribute

In my website, I have implemented an HTML button using Bootstrap to serve as an icon that can toggle the state of an item. Here is the code for the button: <button class='btn' value='${noteid}' onclick='toggleAck(event)'> ...

Angularjs search filter performance slows down significantly when handling large datasets

I am currently working on an AngularJS client application that displays data in a table using the dir-paginate directive from dirPagination.js. Here is the code snippet: <input type="text" ng-change="SomeTask()" ng-model="vm.searchKeyword" /> &l ...

Removing a CSS Class Using Tampermonkey: A Step-by-Step Guide

I'm completely new to CSS and javascript, so please bear with me. My goal is to remove the class disable-stream from each of the div elements located under the div with the class "stream-notifications". Below is an image for reference: Even though I ...

What could be causing React to not re-render the page when the button is clicked?

function MyApp() { const [usersData, setUsersData] = useState([]) useAsyncEffect(async () => { const response = await fetch('https://jsonplaceholder.typicode.com/users') const users = await response.json() setU ...

Retrieve the Firepad textarea element or the current character being typed

I'm looking to add hashtag functionality to Firepad using jQuery. Is there a way to access the textarea element or the character being typed in the Firepad editor? For example, can I trigger an event when typing '#'? I attempted to use the ...

Guide on transferring data from a JSON file to a JavaScript array

Currently, I am manually declaring the countries list for my typeahead search. To streamline this process, I want to retrieve the data from an external JSON file named countries.json. Here is a snippet of what the JSON file contains: [ { "id": ...

Additional GET request made after update request

After the user updates their contact information in the frontend application, the state is updated and a PUT API request is made to update the current information. When updating user contact details with a PUT call, should another GET call be made to retr ...

How to handle javascript and json file processing?

My json data structure is as follows: var json = { "A": { "A1": { "A11": "A", "A12": "B", "A13": "C" }, "A2": { "A21": ...

Pressing the enter key to input password

I have searched through various resources for an answer to my problem, but none of them seem to address it in a way that helps. As a beginner in coding, I may need some extra guidance. Currently, I am only able to submit a password by clicking with the mo ...

What is the best way to conceal two Bootstrap divs that should not both be visible at the same time?

I am working with two different types of charts: an Emotion chart and a Polarity chart. To control the visibility of these charts, I have implemented two buttons, one for each chart. The functionality is such that when the first button is clicked, only the ...

AngularJS: Recommendations for structuring code to dynamically update the DOM in response to AJAX requests

Within Angular's documentation, there is a straightforward example provided on their website: function PhoneListCtrl($scope, $http) { $http.get('phones/phones.json').success(function(data) { $scope.phones = data; }); $scope.order ...

Struggling to fetch data from the Strapi page is posing a challenge

Currently, I am facing an issue where the frontend developers on my team are unable to retrieve data from the backend that I built for them using Strapi. Even after pulling my changes from github, they continue to face difficulties accessing the data. The ...

Is it Possible to Remove an Item from an Array in Vue without Explicitly Knowing the Array's

I'm currently working on a feature that involves removing an item from an array when it is clicked. The code I have so far looks like this: <span @click="deleteItem(index)" v-for="(item, index) in customTaxonomies.featured" v-html="item"></s ...

The map markers are nowhere to be found on the map when using Internet Explorer

Take a look at this code I wrote... var styles = [ { "featureType": "landscape", "stylers": [ {"weight": 0.1}, {"color": "#E7EDEF"} ] }, ... { "featureType": "poi.park", "elementType": "labels", "stylers": [ ...

Traversing through nested arrays within nested objects using AngularJS

In my project, I am utilizing angularjs 1 and dealing with a complex json object that has multiple levels of nesting. My goal is to use ng-repeat in order to access a nested array within the json structure. [{ "information": { "name": "simdi jinki ...

Numerous unique designs paired with exclusive paths

I am working on setting up a system that accommodates multiple layout variations and includes private routes to display specific content based on the user's login status and assigned layout. Currently, I have three different layouts in place, with the ...